<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>Cookie Store API</title>
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<style data-fill-with="stylesheet">/******************************************************************************
 *                   Style sheet for the W3C specifications                   *
 *
 * Special classes handled by this style sheet include:
 *
 * Indices
 *   - .toc for the Table of Contents (<ol class="toc">)
 *     + <span class="secno"> for the section numbers
 *   - #toc for the Table of Contents (<nav id="toc">)
 *   - ul.index for Indices (<a href="#ref">term</a><span>, in §N.M</span>)
 *   - table.index for Index Tables (e.g. for properties or elements)
 *
 * Structural Markup
 *   - table.data for general data tables
 *     -> use 'scope' attribute, <colgroup>, <thead>, and <tbody> for best results !
 *     -> use <table class='complex data'> for extra-complex tables
 *     -> use <td class='long'> for paragraph-length cell content
 *     -> use <td class='pre'> when manual line breaks/indentation would help readability
 *   - dl.switch for switch statements
 *   - ol.algorithm for algorithms (helps to visualize nesting)
 *   - .figure and .caption (HTML4) and figure and figcaption (HTML5)
 *     -> .sidefigure for right-floated figures
 *   - ins/del
 *
 * Code
 *   - pre and code
 *
 * Special Sections
 *   - .note       for informative notes             (div, p, span, aside, details)
 *   - .example    for informative examples          (div, p, pre, span)
 *   - .issue      for issues                        (div, p, span)
 *   - .assertion  for assertions                    (div, p, span)
 *   - .advisement for loud normative statements     (div, p, strong)
 *   - .annoying-warning for spec obsoletion notices (div, aside, details)
 *
 * Definition Boxes
 *   - pre.def   for WebIDL definitions
 *   - table.def for tables that define other entities (e.g. CSS properties)
 *   - dl.def    for definition lists that define other entitles (e.g. HTML elements)
 *
 * Numbering
 *   - .secno for section numbers in .toc and headings (<span class='secno'>3.2</span>)
 *   - .marker for source-inserted example/figure/issue numbers (<span class='marker'>Issue 4</span>)
 *   - ::before styled for CSS-generated issue/example/figure numbers:
 *     -> Documents wishing to use this only need to add
 *        figcaption::before,
 *        .caption::before { content: "Figure "  counter(figure) " ";  }
 *        .example::before { content: "Example " counter(example) " "; }
 *        .issue::before   { content: "Issue "   counter(issue) " ";   }
 *
 * Header Stuff (ignore, just don't conflict with these classes)
 *   - .head for the header
 *   - .copyright for the copyright
 *
 * Miscellaneous
 *   - .overlarge for things that should be as wide as possible, even if
 *     that overflows the body text area. This can be used on an item or
 *     on its container, depending on the effect desired.
 *     Note that this styling basically doesn't help at all when printing,
 *     since A4 paper isn't much wider than the max-width here.
 *     It's better to design things to fit into a narrower measure if possible.
 *   - js-added ToC jump links (see fixup.js)
 *
 ******************************************************************************/

/******************************************************************************/
/*                                   Body                                     */
/******************************************************************************/

	body {
		counter-reset: example figure issue;

		/* Layout */
		max-width: 50em;               /* limit line length to 50em for readability   */
		margin: 0 auto;                /* center text within page                     */
		padding: 1.6em 1.5em 2em 50px; /* assume 16px font size for downlevel clients */
		padding: 1.6em 1.5em 2em calc(26px + 1.5em); /* leave space for status flag     */

		/* Typography */
		line-height: 1.5;
		font-family: sans-serif;
		widows: 2;
		orphans: 2;
		word-wrap: break-word;
		overflow-wrap: break-word;
		hyphens: auto;

		/* Colors */
		color: black;
		background: white top left fixed no-repeat;
		background-size: 25px auto;
	}


/******************************************************************************/
/*                         Front Matter & Navigation                          */
/******************************************************************************/

/** Header ********************************************************************/

	div.head { margin-bottom: 1em }
	div.head hr { border-style: solid; }

	div.head h1 {
		font-weight: bold;
		margin: 0 0 .1em;
		font-size: 220%;
	}

	div.head h2 { margin-bottom: 1.5em;}

/** W3C Logo ******************************************************************/

	.head .logo {
		float: right;
		margin: 0.4rem 0 0.2rem .4rem;
	}

	.head img[src*="logos/W3C"] {
		display: block;
		border: solid #1a5e9a;
		border-width: .65rem .7rem .6rem;
		border-radius: .4rem;
		background: #1a5e9a;
		color: white;
		font-weight: bold;
	}

	.head a:hover > img[src*="logos/W3C"],
	.head a:focus > img[src*="logos/W3C"] {
		opacity: .8;
	}

	.head a:active > img[src*="logos/W3C"] {
		background: #c00;
		border-color: #c00;
	}

	/* see also additional rules in Link Styling section */

/** Copyright *****************************************************************/

	p.copyright,
	p.copyright small { font-size: small }

/** Back to Top / ToC Toggle **************************************************/

	@media print {
		#toc-nav {
			display: none;
		}
	}
	@media not print {
		#toc-nav {
			position: fixed;
			z-index: 2;
			bottom: 0; left: 0;
			margin: 0;
			min-width: 1.33em;
			border-top-right-radius: 2rem;
			box-shadow: 0 0 2px;
			font-size: 1.5em;
			color: black;
		}
		#toc-nav > a {
			display: block;
			white-space: nowrap;

			height: 1.33em;
			padding: .1em 0.3em;
			margin: 0;

			background: white;
			box-shadow: 0 0 2px;
			border: none;
			border-top-right-radius: 1.33em;
			background: white;
		}
		#toc-nav > #toc-jump {
			padding-bottom: 2em;
			margin-bottom: -1.9em;
		}

		#toc-nav > a:hover,
		#toc-nav > a:focus {
			background: #f8f8f8;
		}
		#toc-nav > a:not(:hover):not(:focus) {
			color: #707070;
		}

		/* statusbar gets in the way on keyboard focus; remove once browsers fix */
		#toc-nav > a[href="#toc"]:not(:hover):focus:last-child {
			padding-bottom: 1.5rem;
		}

		#toc-nav:not(:hover) > a:not(:focus) > span + span {
			/* Ideally this uses :focus-within on #toc-nav */
			display: none;
		}
		#toc-nav > a > span + span {
			padding-right: 0.2em;
		}

		#toc-toggle-inline {
			vertical-align: 0.05em;
			font-size: 80%;
			color: gray;
			color: hsla(203,20%,40%,.7);
			border-style: none;
			background: transparent;
			position: relative;
		}
		#toc-toggle-inline:hover:not(:active),
		#toc-toggle-inline:focus:not(:active) {
			text-shadow: 1px 1px silver;
			top: -1px;
			left: -1px;
		}

		#toc-nav :active {
			color: #C00;
		}
	}

/** ToC Sidebar ***************************************************************/

	/* Floating sidebar */
	@media screen {
		body.toc-sidebar #toc {
			position: fixed;
			top: 0; bottom: 0;
			left: 0;
			width: 23.5em;
			max-width: 80%;
			max-width: calc(100% - 2em - 26px);
			overflow: auto;
			padding: 0 1em;
			padding-left: 42px;
			padding-left: calc(1em + 26px);
			background: inherit;
			background-color: #f7f8f9;
			z-index: 1;
			box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
		}
		body.toc-sidebar #toc h2 {
			margin-top: .8rem;
			font-variant: small-caps;
			font-variant: all-small-caps;
			text-transform: lowercase;
			font-weight: bold;
			color: gray;
			color: hsla(203,20%,40%,.7);
		}
		body.toc-sidebar #toc-jump:not(:focus) {
			width: 0;
			height: 0;
			padding: 0;
			position: absolute;
			overflow: hidden;
		}
	}
	/* Hide main scroller when only the ToC is visible anyway */
	@media screen and (max-width: 28em) {
		body.toc-sidebar {
			overflow: hidden;
		}
	}

	/* Sidebar with its own space */
	@media screen and (min-width: 78em) {
		body:not(.toc-inline) #toc {
			position: fixed;
			top: 0; bottom: 0;
			left: 0;
			width: 23.5em;
			overflow: auto;
			padding: 0 1em;
			padding-left: 42px;
			padding-left: calc(1em + 26px);
			background: inherit;
			background-color: #f7f8f9;
			z-index: 1;
			box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
		}
		body:not(.toc-inline) #toc h2 {
			margin-top: .8rem;
			font-variant: small-caps;
			font-variant: all-small-caps;
			text-transform: lowercase;
			font-weight: bold;
			color: gray;
			color: hsla(203,20%,40%,.7);
		}

		body:not(.toc-inline) {
			padding-left: 29em;
		}
		/* See also Overflow section at the bottom */

		body:not(.toc-inline) #toc-jump:not(:focus) {
			width: 0;
			height: 0;
			padding: 0;
			position: absolute;
			overflow: hidden;
		}
	}
	@media screen and (min-width: 90em) {
		body:not(.toc-inline) {
			margin: 0 4em;
		}
	}

/******************************************************************************/
/*                                Sectioning                                  */
/******************************************************************************/

/** Headings ******************************************************************/

	h1, h2, h3, h4, h5, h6, dt {
		page-break-after: avoid;
		page-break-inside: avoid;
		font: 100% sans-serif;   /* Reset all font styling to clear out UA styles */
		font-family: inherit;    /* Inherit the font family. */
		line-height: 1.2;        /* Keep wrapped headings compact */
		hyphens: manual;         /* Hyphenated headings look weird */
	}

	h2, h3, h4, h5, h6 {
		margin-top: 3rem;
	}

	h1, h2, h3 {
		color: #005A9C;
		background: transparent;
	}

	h1 { font-size: 170%; }
	h2 { font-size: 140%; }
	h3 { font-size: 120%; }
	h4 { font-weight: bold; }
	h5 { font-style: italic; }
	h6 { font-variant: small-caps; }
	dt { font-weight: bold; }

/** Subheadings ***************************************************************/

	h1 + h2,
	#subtitle {
		/* #subtitle is a subtitle in an H2 under the H1 */
		margin-top: 0;
	}
	h2 + h3,
	h3 + h4,
	h4 + h5,
	h5 + h6 {
		margin-top: 1.2em; /* = 1 x line-height */
	}

/** Section divider ***********************************************************/

	:not(.head) > hr {
		font-size: 1.5em;
		text-align: center;
		margin: 1em auto;
		height: auto;
		border: transparent solid 0;
		background: transparent;
	}
	:not(.head) > hr::before {
		content: "\2727\2003\2003\2727\2003\2003\2727";
	}

/******************************************************************************/
/*                            Paragraphs and Lists                            */
/******************************************************************************/

	p {
		margin: 1em 0;
	}

	dd > p:first-child,
	li > p:first-child {
		margin-top: 0;
	}

	ul, ol {
		margin-left: 0;
		padding-left: 2em;
	}

	li {
		margin: 0.25em 0 0.5em;
		padding: 0;
	}

	dl dd {
		margin: 0 0 .5em 2em;
	}

	.head dd + dd { /* compact for header */
		margin-top: -.5em;
	}

	/* Style for algorithms */
	ol.algorithm ol:not(.algorithm),
	.algorithm > ol ol:not(.algorithm) {
	 border-left: 0.5em solid #DEF;
	}

	/* Put nice boxes around each algorithm. */
	[data-algorithm]:not(.heading) {
	  padding: .5em;
	  border: thin solid #ddd; border-radius: .5em;
	  margin: .5em calc(-0.5em - 1px);
	}
	[data-algorithm]:not(.heading) > :first-child {
	  margin-top: 0;
	}
	[data-algorithm]:not(.heading) > :last-child {
	  margin-bottom: 0;
	}

	/* Style for switch/case <dl>s */
	dl.switch > dd > ol.only,
	dl.switch > dd > .only > ol {
	 margin-left: 0;
	}
	dl.switch > dd > ol.algorithm,
	dl.switch > dd > .algorithm > ol {
	 margin-left: -2em;
	}
	dl.switch {
	 padding-left: 2em;
	}
	dl.switch > dt {
	 text-indent: -1.5em;
	 margin-top: 1em;
	}
	dl.switch > dt + dt {
	 margin-top: 0;
	}
	dl.switch > dt::before {
	 content: '\21AA';
	 padding: 0 0.5em 0 0;
	 display: inline-block;
	 width: 1em;
	 text-align: right;
	 line-height: 0.5em;
	}

/** Terminology Markup ********************************************************/


/******************************************************************************/
/*                                 Inline Markup                              */
/******************************************************************************/

/** Terminology Markup ********************************************************/
	dfn   { /* Defining instance */
		font-weight: bolder;
	}
	a > i { /* Instance of term */
		font-style: normal;
	}
	dt dfn code, code.idl {
		font-size: medium;
	}
	dfn var {
		font-style: normal;
	}

/** Change Marking ************************************************************/

	del { color: red;  text-decoration: line-through; }
	ins { color: #080; text-decoration: underline;    }

/** Miscellaneous improvements to inline formatting ***************************/

	sup {
		vertical-align: super;
		font-size: 80%
	}

/******************************************************************************/
/*                                    Code                                    */
/******************************************************************************/

/** General monospace/pre rules ***********************************************/

	pre, code, samp {
		font-family: Menlo, Consolas, "DejaVu Sans Mono", Monaco, monospace;
		font-size: .9em;
		page-break-inside: avoid;
		hyphens: none;
		text-transform: none;
	}
	pre code,
	code code {
		font-size: 100%;
	}

	pre {
		margin-top: 1em;
		margin-bottom: 1em;
		overflow: auto;
	}

/** Inline Code fragments *****************************************************/

  /* Do something nice. */

/******************************************************************************/
/*                                    Links                                   */
/******************************************************************************/

/** General Hyperlinks ********************************************************/

	/* We hyperlink a lot, so make it less intrusive */
	a[href] {
		color: #034575;
		text-decoration: none;
		border-bottom: 1px solid #707070;
		/* Need a bit of extending for it to look okay */
		padding: 0 1px 0;
		margin: 0 -1px 0;
	}
	a:visited {
		border-bottom-color: #BBB;
	}

	/* Use distinguishing colors when user is interacting with the link */
	a[href]:focus,
	a[href]:hover {
		background: #f8f8f8;
		background: rgba(75%, 75%, 75%, .25);
		border-bottom-width: 3px;
		margin-bottom: -2px;
	}
	a[href]:active {
		color: #C00;
		border-color: #C00;
	}

	/* Backout above styling for W3C logo */
	.head .logo,
	.head .logo a {
		border: none;
		text-decoration: none;
		background: transparent;
	}

/******************************************************************************/
/*                                    Images                                  */
/******************************************************************************/

	img {
		border-style: none;
	}

	/* For autogen numbers, add
	   .caption::before, figcaption::before { content: "Figure " counter(figure) ". "; }
	*/

	figure, .figure, .sidefigure {
		page-break-inside: avoid;
		text-align: center;
		margin: 2.5em 0;
	}
	.figure img,    .sidefigure img,    figure img,
	.figure object, .sidefigure object, figure object {
		max-width: 100%;
		margin: auto;
	}
	.figure pre, .sidefigure pre, figure pre {
		text-align: left;
		display: table;
		margin: 1em auto;
	}
	.figure table, figure table {
		margin: auto;
	}
	@media screen and (min-width: 20em) {
		.sidefigure {
			float: right;
			width: 50%;
			margin: 0 0 0.5em 0.5em
		}
	}
	.caption, figcaption, caption {
		font-style: italic;
		font-size: 90%;
	}
	.caption::before, figcaption::before, figcaption > .marker {
		font-weight: bold;
	}
	.caption, figcaption {
		counter-increment: figure;
	}

	/* DL list is indented 2em, but figure inside it is not */
	dd > .figure, dd > figure { margin-left: -2em }

/******************************************************************************/
/*                             Colored Boxes                                  */
/******************************************************************************/

	.issue, .note, .example, .assertion, .advisement, blockquote {
		padding: .5em;
		border: .5em;
		border-left-style: solid;
		page-break-inside: avoid;
	}
	span.issue, span.note {
		padding: .1em .5em .15em;
		border-right-style: solid;
	}

	.issue,
	.note,
	.example,
	.advisement,
	.assertion,
	blockquote {
		margin: 1em auto;
	}
	.note  > p:first-child,
	.issue > p:first-child,
	blockquote > :first-child {
		margin-top: 0;
	}
	blockquote > :last-child {
		margin-bottom: 0;
	}

/** Blockquotes ***************************************************************/

	blockquote {
		border-color: silver;
	}

/** Open issue ****************************************************************/

	.issue {
		border-color: #E05252;
		background: #FBE9E9;
		counter-increment: issue;
		overflow: auto;
	}
	.issue::before, .issue > .marker {
		text-transform: uppercase;
		color: #AE1E1E;
		padding-right: 1em;
		text-transform: uppercase;
	}
	/* Add .issue::before { content: "Issue " counter(issue) " "; } for autogen numbers,
	   or use class="marker" to mark up the issue number in source. */

/** Example *******************************************************************/

	.example {
		border-color: #E0CB52;
		background: #FCFAEE;
		counter-increment: example;
		overflow: auto;
		clear: both;
	}
	.example::before, .example > .marker {
		text-transform: uppercase;
		color: #827017;
		min-width: 7.5em;
		display: block;
	}
	/* Add .example::before { content: "Example " counter(example) " "; } for autogen numbers,
	   or use class="marker" to mark up the example number in source. */

/** Non-normative Note ********************************************************/

	.note {
		border-color: #52E052;
		background: #E9FBE9;
		overflow: auto;
	}

	.note::before, .note > .marker,
	details.note > summary::before,
	details.note > summary > .marker {
		text-transform: uppercase;
		display: block;
		color: hsl(120, 70%, 30%);
	}
	/* Add .note::before { content: "Note"; } for autogen label,
	   or use class="marker" to mark up the label in source. */

	details.note > summary {
		display: block;
		color: hsl(120, 70%, 30%);
	}
	details.note[open] > summary {
		border-bottom: 1px silver solid;
	}

/** Assertion Box *************************************************************/
	/*  for assertions in algorithms */

	.assertion {
		border-color: #AAA;
		background: #EEE;
	}

/** Advisement Box ************************************************************/
	/*  for attention-grabbing normative statements */

	.advisement {
		border-color: orange;
		border-style: none solid;
		background: #FFEECC;
	}
	strong.advisement {
		display: block;
		text-align: center;
	}
	.advisement > .marker {
		color: #B35F00;
	}

/** Spec Obsoletion Notice ****************************************************/
	/* obnoxious obsoletion notice for older/abandoned specs. */

	details {
		display: block;
	}
	summary {
		font-weight: bolder;
	}

	.annoying-warning:not(details),
	details.annoying-warning:not([open]) > summary,
	details.annoying-warning[open] {
		background: #fdd;
		color: red;
		font-weight: bold;
		padding: .75em 1em;
		border: thick red;
		border-style: solid;
		border-radius: 1em;
	}
	.annoying-warning :last-child {
		margin-bottom: 0;
	}

@media not print {
	details.annoying-warning[open] {
		position: fixed;
		left: 1em;
		right: 1em;
		bottom: 1em;
		z-index: 1000;
	}
}

	details.annoying-warning:not([open]) > summary {
		text-align: center;
	}

/** Entity Definition Boxes ***************************************************/

	.def {
		padding: .5em 1em;
		background: #DEF;
		margin: 1.2em 0;
		border-left: 0.5em solid #8CCBF2;
	}

/******************************************************************************/
/*                                    Tables                                  */
/******************************************************************************/

	th, td {
		text-align: left;
		text-align: start;
	}

/** Property/Descriptor Definition Tables *************************************/

	table.def {
		/* inherits .def box styling, see above */
		width: 100%;
		border-spacing: 0;
	}

	table.def td,
	table.def th {
		padding: 0.5em;
		vertical-align: baseline;
		border-bottom: 1px solid #bbd7e9;
	}

	table.def > tbody > tr:last-child th,
	table.def > tbody > tr:last-child td {
		border-bottom: 0;
	}

	table.def th {
		font-style: italic;
		font-weight: normal;
		padding-left: 1em;
		width: 3em;
	}

	/* For when values are extra-complex and need formatting for readability */
	table td.pre {
		white-space: pre-wrap;
	}

	/* A footnote at the bottom of a def table */
	table.def           td.footnote {
		padding-top: 0.6em;
	}
	table.def           td.footnote::before {
		content: " ";
		display: block;
		height: 0.6em;
		width: 4em;
		border-top: thin solid;
	}

/** Data tables (and properly marked-up index tables) *************************/
	/*
		 <table class="data"> highlights structural relationships in a table
		 when correct markup is used (e.g. thead/tbody, th vs. td, scope attribute)

		 Use class="complex data" for particularly complicated tables --
		 (This will draw more lines: busier, but clearer.)

		 Use class="long" on table cells with paragraph-like contents
		 (This will adjust text alignment accordingly.)
		 Alternately use class="longlastcol" on tables, to have the last column assume "long".
	*/

	table {
		word-wrap: normal;
		overflow-wrap: normal;
		hyphens: manual;
	}

	table.data,
	table.index {
		margin: 1em auto;
		border-collapse: collapse;
		border: hidden;
		width: 100%;
	}
	table.data caption,
	table.index caption {
		max-width: 50em;
		margin: 0 auto 1em;
	}

	table.data td,  table.data th,
	table.index td, table.index th {
		padding: 0.5em 1em;
		border-width: 1px;
		border-color: silver;
		border-top-style: solid;
	}

	table.data thead td:empty {
		padding: 0;
		border: 0;
	}

	table.data  thead,
	table.index thead,
	table.data  tbody,
	table.index tbody {
		border-bottom: 2px solid;
	}

	table.data colgroup,
	table.index colgroup {
		border-left: 2px solid;
	}

	table.data  tbody th:first-child,
	table.index tbody th:first-child  {
		border-right: 2px solid;
		border-top: 1px solid silver;
		padding-right: 1em;
	}

	table.data th[colspan],
	table.data td[colspan] {
		text-align: center;
	}

	table.complex.data th,
	table.complex.data td {
		border: 1px solid silver;
		text-align: center;
	}

	table.data.longlastcol td:last-child,
	table.data td.long {
	 vertical-align: baseline;
	 text-align: left;
	}

	table.data img {
		vertical-align: middle;
	}


/*
Alternate table alignment rules

	table.data,
	table.index {
		text-align: center;
	}

	table.data  thead th[scope="row"],
	table.index thead th[scope="row"] {
		text-align: right;
	}

	table.data  tbody th:first-child,
	table.index tbody th:first-child  {
		text-align: right;
	}

Possible extra rowspan handling

	table.data  tbody th[rowspan]:not([rowspan='1']),
	table.index tbody th[rowspan]:not([rowspan='1']),
	table.data  tbody td[rowspan]:not([rowspan='1']),
	table.index tbody td[rowspan]:not([rowspan='1']) {
		border-left: 1px solid silver;
	}

	table.data  tbody th[rowspan]:first-child,
	table.index tbody th[rowspan]:first-child,
	table.data  tbody td[rowspan]:first-child,
	table.index tbody td[rowspan]:first-child{
		border-left: 0;
		border-right: 1px solid silver;
	}
*/

/******************************************************************************/
/*                                  Indices                                   */
/******************************************************************************/


/** Table of Contents *********************************************************/

	.toc a {
		/* More spacing; use padding to make it part of the click target. */
		padding-top: 0.1rem;
		/* Larger, more consistently-sized click target */
		display: block;
		/* Reverse color scheme */
		color: black;
		border-color: #3980B5;
		border-bottom-width: 3px !important;
		margin-bottom: 0px !important;
	}
	.toc a:visited {
		border-color: #054572;
	}
	.toc a:not(:focus):not(:hover) {
		/* Allow colors to cascade through from link styling */
		border-bottom-color: transparent;
	}

	.toc, .toc ol, .toc ul, .toc li {
		list-style: none; /* Numbers must be inlined into source */
		/* because generated content isn't search/selectable and markers can't do multilevel yet */
		margin:  0;
		padding: 0;
		line-height: 1.1rem; /* consistent spacing */
	}

	/* ToC not indented until third level, but font style & margins show hierarchy */
	.toc > li             { font-weight: bold;   }
	.toc > li li          { font-weight: normal; }
	.toc > li li li       { font-size:   95%;    }
	.toc > li li li li    { font-size:   90%;    }
	.toc > li li li li .secno { font-size: 85%; }
	.toc > li li li li li { font-size:   85%;    }
	.toc > li li li li li .secno { font-size: 100%; }

	/* @supports not (display:grid) { */
		.toc > li             { margin: 1.5rem 0;    }
		.toc > li li          { margin: 0.3rem 0;    }
		.toc > li li li       { margin-left: 2rem;   }

		/* Section numbers in a column of their own */
		.toc .secno {
			float: left;
			width: 4rem;
			white-space: nowrap;
		}

		.toc li {
			clear: both;
		}

		:not(li) > .toc              { margin-left:  5rem; }
		.toc .secno                  { margin-left: -5rem; }
		.toc > li li li .secno       { margin-left: -7rem; }
		.toc > li li li li .secno    { margin-left: -9rem; }
		.toc > li li li li li .secno { margin-left: -11rem; }

		/* Tighten up indentation in narrow ToCs */
		@media (max-width: 30em) {
			:not(li) > .toc              { margin-left:  4rem; }
			.toc .secno                  { margin-left: -4rem; }
			.toc > li li li              { margin-left:  1rem; }
			.toc > li li li .secno       { margin-left: -5rem; }
			.toc > li li li li .secno    { margin-left: -6rem; }
			.toc > li li li li li .secno { margin-left: -7rem; }
		}
	/* } */

	@supports (display:grid) and (display:contents) {
		/* Use #toc over .toc to override non-@supports rules. */
		#toc {
			display: grid;
			align-content: start;
			grid-template-columns: auto 1fr;
			grid-column-gap: 1rem;
			column-gap: 1rem;
			grid-row-gap: .6rem;
			row-gap: .6rem;
		}
		#toc h2 {
			grid-column: 1 / -1;
			margin-bottom: 0;
		}
		#toc ol,
		#toc li,
		#toc a {
			display: contents;
			/* Switch <a> to subgrid when supported */
		}
		#toc span {
			margin: 0;
		}
		#toc > .toc > li > a > span {
			/* The spans of the top-level list,
			   comprising the first items of each top-level section. */
			margin-top: 1.1rem;
		}
		#toc#toc .secno { /* Ugh, need more specificity to override base.css */
			grid-column: 1;
			width: auto;
			margin-left: 0;
		}
		#toc .content {
			grid-column: 2;
			width: auto;
			margin-right: 1rem;
		}
		#toc .content:hover {
			background: rgba(75%, 75%, 75%, .25);
			border-bottom: 3px solid #054572;
			margin-bottom: -3px;
		}
		#toc li li li .content {
			margin-left: 1rem;
		}
		#toc li li li li .content {
			margin-left: 2rem;
		}
	}


/** Index *********************************************************************/

	/* Index Lists: Layout */
	ul.index       { margin-left: 0; columns: 15em; text-indent: 1em hanging; }
	ul.index li    { margin-left: 0; list-style: none; break-inside: avoid; }
	ul.index li li { margin-left: 1em }
	ul.index dl    { margin-top: 0; }
	ul.index dt    { margin: .2em 0 .2em 20px;}
	ul.index dd    { margin: .2em 0 .2em 40px;}
	/* Index Lists: Typography */
	ul.index ul,
	ul.index dl { font-size: smaller; }
	@media not print {
		ul.index li span {
			white-space: nowrap;
			color: transparent; }
		ul.index li a:hover + span,
		ul.index li a:focus + span {
			color: #707070;
		}
	}

/** Index Tables *****************************************************/
	/* See also the data table styling section, which this effectively subclasses */

	table.index {
		font-size: small;
		border-collapse: collapse;
		border-spacing: 0;
		text-align: left;
		margin: 1em 0;
	}

	table.index td,
	table.index th {
		padding: 0.4em;
	}

	table.index tr:hover td:not([rowspan]),
	table.index tr:hover th:not([rowspan]) {
		background: #f7f8f9;
	}

	/* The link in the first column in the property table (formerly a TD) */
	table.index th:first-child a {
		font-weight: bold;
	}

/******************************************************************************/
/*                                    Print                                   */
/******************************************************************************/

	@media print {
		/* Pages have their own margins. */
		html {
			margin: 0;
		}
		/* Serif for print. */
		body {
			font-family: serif;
		}
	}
	@page {
		margin: 1.5cm 1.1cm;
	}

/******************************************************************************/
/*                                    Legacy                                  */
/******************************************************************************/

	/* This rule is inherited from past style sheets. No idea what it's for. */
	.hide { display: none }



/******************************************************************************/
/*                             Overflow Control                               */
/******************************************************************************/

	.figure .caption, .sidefigure .caption, figcaption {
		/* in case figure is overlarge, limit caption to 50em */
		max-width: 50rem;
		margin-left: auto;
		margin-right: auto;
	}
	.overlarge {
		/* Magic to create good table positioning:
		   "content column" is 50ems wide at max; less on smaller screens.
		   Extra space (after ToC + content) is empty on the right.

		   1. When table < content column, centers table in column.
		   2. When content < table < available, left-aligns.
		   3. When table > available, fills available + scroll bar.
		*/ 
		display: grid;
		grid-template-columns: minmax(0, 50em);
	}
	.overlarge > table {
		/* limit preferred width of table */
		max-width: 50em;
		margin-left: auto;
		margin-right: auto;
	}

	@media (min-width: 55em) {
		.overlarge {
			margin-right: calc(13px + 26.5rem - 50vw);
			max-width: none;
		}
	}
	@media screen and (min-width: 78em) {
		body:not(.toc-inline) .overlarge {
			/* 30.5em body padding 50em content area */
			margin-right: calc(40em - 50vw) !important;
		}
	}
	@media screen and (min-width: 90em) {
		body:not(.toc-inline) .overlarge {
			/* 4em html margin 30.5em body padding 50em content area */
			margin-right: calc(84.5em - 100vw) !important;
		}
	}

	@media not print {
		.overlarge {
			overflow-x: auto;
			/* See Lea Verou's explanation background-attachment:
			 * http://lea.verou.me/2012/04/background-attachment-local/
			 *
			background: top left  / 4em 100% linear-gradient(to right,  #ffffff, rgba(255, 255, 255, 0)) local,
			            top right / 4em 100% linear-gradient(to left, #ffffff, rgba(255, 255, 255, 0)) local,
			            top left  / 1em 100% linear-gradient(to right,  #c3c3c5, rgba(195, 195, 197, 0)) scroll,
			            top right / 1em 100% linear-gradient(to left, #c3c3c5, rgba(195, 195, 197, 0)) scroll,
			            white;
			background-repeat: no-repeat;
			*/
		}
	}
</style>
  <link href="https://www.w3.org/StyleSheets/TR/2016/cg-draft" rel="stylesheet">
  <link href="https://wicg.github.io/cookie-store/" rel="canonical">
  <link href="logo-cookies.png" rel="icon">
<style>
dl.domintro dt {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", Monaco, monospace;

    padding-top: 0.5em;
    padding-bottom: 1em;
}
dl.domintro dt a {
    color: inherit; border-bottom-style: none;
}
dl.domintro dt code {
    font-size: inherit;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-syntax-highlighting */
pre.idl.highlight { color: #708090; }
.highlight:not(.idl) { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
c-[a] { color: #990055 } /* Keyword.Declaration */
c-[b] { color: #990055 } /* Keyword.Type */
c-[c] { color: #708090 } /* Comment */
c-[d] { color: #708090 } /* Comment.Multiline */
c-[e] { color: #0077aa } /* Name.Attribute */
c-[f] { color: #669900 } /* Name.Tag */
c-[g] { color: #222222 } /* Name.Variable */
c-[k] { color: #990055 } /* Keyword */
c-[l] { color: #000000 } /* Literal */
c-[m] { color: #000000 } /* Literal.Number */
c-[n] { color: #0077aa } /* Name */
c-[o] { color: #999999 } /* Operator */
c-[p] { color: #999999 } /* Punctuation */
c-[s] { color: #a67f59 } /* Literal.String */
c-[t] { color: #a67f59 } /* Literal.String.Single */
c-[u] { color: #a67f59 } /* Literal.String.Double */
c-[cp] { color: #708090 } /* Comment.Preproc */
c-[c1] { color: #708090 } /* Comment.Single */
c-[cs] { color: #708090 } /* Comment.Special */
c-[kc] { color: #990055 } /* Keyword.Constant */
c-[kn] { color: #990055 } /* Keyword.Namespace */
c-[kp] { color: #990055 } /* Keyword.Pseudo */
c-[kr] { color: #990055 } /* Keyword.Reserved */
c-[ld] { color: #000000 } /* Literal.Date */
c-[nc] { color: #0077aa } /* Name.Class */
c-[no] { color: #0077aa } /* Name.Constant */
c-[nd] { color: #0077aa } /* Name.Decorator */
c-[ni] { color: #0077aa } /* Name.Entity */
c-[ne] { color: #0077aa } /* Name.Exception */
c-[nf] { color: #0077aa } /* Name.Function */
c-[nl] { color: #0077aa } /* Name.Label */
c-[nn] { color: #0077aa } /* Name.Namespace */
c-[py] { color: #0077aa } /* Name.Property */
c-[ow] { color: #999999 } /* Operator.Word */
c-[mb] { color: #000000 } /* Literal.Number.Bin */
c-[mf] { color: #000000 } /* Literal.Number.Float */
c-[mh] { color: #000000 } /* Literal.Number.Hex */
c-[mi] { color: #000000 } /* Literal.Number.Integer */
c-[mo] { color: #000000 } /* Literal.Number.Oct */
c-[sb] { color: #a67f59 } /* Literal.String.Backtick */
c-[sc] { color: #a67f59 } /* Literal.String.Char */
c-[sd] { color: #a67f59 } /* Literal.String.Doc */
c-[se] { color: #a67f59 } /* Literal.String.Escape */
c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */
c-[si] { color: #a67f59 } /* Literal.String.Interpol */
c-[sx] { color: #a67f59 } /* Literal.String.Other */
c-[sr] { color: #a67f59 } /* Literal.String.Regex */
c-[ss] { color: #a67f59 } /* Literal.String.Symbol */
c-[vc] { color: #0077aa } /* Name.Variable.Class */
c-[vg] { color: #0077aa } /* Name.Variable.Global */
c-[vi] { color: #0077aa } /* Name.Variable.Instance */
c-[il] { color: #000000 } /* Literal.Number.Integer.Long */
</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"></p>
   <h1 class="p-name no-ref" id="title">Cookie Store API</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Draft Community Group Report, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <div data-fill-with="spec-metadata">
    <dl>
     <dt>This version:
     <dd><a class="u-url" href="https://wicg.github.io/cookie-store/">https://wicg.github.io/cookie-store/</a>
     <dt>Test Suite:
     <dd><a href="https://github.com/web-platform-tests/wpt/tree/master/cookie-store">https://github.com/web-platform-tests/wpt/tree/master/cookie-store</a>
     <dt class="editor">Editors:
     <dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:costan@google.com">Victor Costan</a> (<a class="p-org org" href="https://google.com">Google Inc.</a>)
     <dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:jsbell@google.com">Joshua Bell</a> (<a class="p-org org" href="https://google.com">Google Inc.</a>)
     <dt class="editor">Former Editor:
     <dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:rtoy@google.com">Raymond Toy</a> (<a class="p-org org" href="https://google.com">Google Inc.</a>)
    </dl>
   </div>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1970 the Contributors to the Cookie Store API Specification, published by the <a href="https://www.w3.org/community/wicg/">Web Platform Incubator Community Group</a> under the <a href="https://www.w3.org/community/about/agreements/cla/">W3C Community Contributor License Agreement (CLA)</a>.
A human-readable <a href="http://www.w3.org/community/about/agreements/cla-deed/">summary</a> is available. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>An asynchronous Javascript cookies API for documents and workers</p>
  </div>
  <div data-fill-with="at-risk"></div>
  <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p> This specification was published by the <a href="https://www.w3.org/community/wicg/">Web Platform Incubator Community Group</a>.
  It is not a W3C Standard nor is it on the W3C Standards Track.

  Please note that under the <a href="https://www.w3.org/community/about/agreements/cla/">W3C Community Contributor License Agreement (CLA)</a> there is a limited opt-out and other conditions apply.

  Learn more about <a href="http://www.w3.org/community/">W3C Community and Business Groups</a>. </p>
   <p></p>
  </div>
  <div data-fill-with="at-risk"></div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li>
     <a href="#intro"><span class="secno">1</span> <span class="content">Introduction</span></a>
     <ol class="toc">
      <li><a href="#intro-proposed-change"><span class="secno">1.1</span> <span class="content">A Taste of the Proposed Change</span></a>
      <li>
       <a href="#intro-summary"><span class="secno">1.2</span> <span class="content">Summary</span></a>
       <ol class="toc">
        <li><a href="#script-visibility"><span class="secno">1.2.1</span> <span class="content">Script visibility</span></a>
        <li><a href="#intro-motivation"><span class="secno">1.2.2</span> <span class="content">Motivations</span></a>
        <li><a href="#intro-opinions"><span class="secno">1.2.3</span> <span class="content">Opinions</span></a>
        <li><a href="#intro-compat"><span class="secno">1.2.4</span> <span class="content">Compatiblity</span></a>
       </ol>
      <li><a href="#intro-query"><span class="secno">1.3</span> <span class="content">Querying Cookies</span></a>
      <li><a href="#intro-modify"><span class="secno">1.4</span> <span class="content">Modifying Cookies</span></a>
      <li><a href="#intro-monitor"><span class="secno">1.5</span> <span class="content">Monitoring Cookies</span></a>
     </ol>
    <li>
     <a href="#concepts"><span class="secno">2</span> <span class="content">Concepts</span></a>
     <ol class="toc">
      <li><a href="#cookie-concept"><span class="secno">2.1</span> <span class="content">Cookie</span></a>
      <li><a href="#cookie-store--concept"><span class="secno">2.2</span> <span class="content">Cookie Store</span></a>
      <li><a href="#service-worker-extensions"><span class="secno">2.3</span> <span class="content">Extensions to Service Worker</span></a>
     </ol>
    <li>
     <a href="#CookieStore"><span class="secno">3</span> <span class="content">The <code class="idl"><span>CookieStore</span></code> Interface</span></a>
     <ol class="toc">
      <li><a href="#CookieStore-get"><span class="secno">3.1</span> <span class="content">The <code class="idl"><span>get()</span></code> method</span></a>
      <li><a href="#CookieStore-getAll"><span class="secno">3.2</span> <span class="content">The <code class="idl"><span>getAll()</span></code> method</span></a>
      <li><a href="#CookieStore-set"><span class="secno">3.3</span> <span class="content">The <code class="idl"><span>set()</span></code> method</span></a>
      <li><a href="#CookieStore-delete"><span class="secno">3.4</span> <span class="content">The <code class="idl"><span>delete()</span></code> method</span></a>
      <li><a href="#CookieStore-subscribeToChanges"><span class="secno">3.5</span> <span class="content">The <code class="idl"><span>subscribeToChanges()</span></code> method</span></a>
      <li><a href="#CookieStore-getChangeSubscriptions"><span class="secno">3.6</span> <span class="content">The <code class="idl"><span>getChangeSubscriptions()</span></code> method</span></a>
     </ol>
    <li>
     <a href="#event-interfaces"><span class="secno">4</span> <span class="content">Event Interfaces</span></a>
     <ol class="toc">
      <li><a href="#CookieChangeEvent"><span class="secno">4.1</span> <span class="content">The <code class="idl"><span>CookieChangeEvent</span></code> interface</span></a>
      <li><a href="#ExtendableCookieChangeEvent"><span class="secno">4.2</span> <span class="content">The <code class="idl"><span>ExtendableCookieChangeEvent</span></code> interface</span></a>
     </ol>
    <li>
     <a href="#globals"><span class="secno">5</span> <span class="content">Global Interfaces</span></a>
     <ol class="toc">
      <li><a href="#Window"><span class="secno">5.1</span> <span class="content">The <code class="idl"><span>Window</span></code> interface</span></a>
      <li><a href="#ServiceWorkerGlobalScope"><span class="secno">5.2</span> <span class="content">The <code class="idl"><span>ServiceWorkerGlobalScope</span></code> interface</span></a>
     </ol>
    <li>
     <a href="#algorithms"><span class="secno">6</span> <span class="content">Algorithms</span></a>
     <ol class="toc">
      <li><a href="#query-cookies-algorithm"><span class="secno">6.1</span> <span class="content">Query Cookies</span></a>
      <li><a href="#set-cookie-algorithm"><span class="secno">6.2</span> <span class="content">Set a Cookie</span></a>
      <li><a href="#delete-cookie-algorithm"><span class="secno">6.3</span> <span class="content">Delete a Cookie</span></a>
      <li><a href="#process-changes"><span class="secno">6.4</span> <span class="content">Process Changes</span></a>
     </ol>
    <li>
     <a href="#security"><span class="secno">7</span> <span class="content">Security</span></a>
     <ol class="toc">
      <li><a href="#gotcha"><span class="secno">7.1</span> <span class="content">Gotcha!</span></a>
      <li><a href="#restrict"><span class="secno">7.2</span> <span class="content">Restrict?</span></a>
      <li><a href="#surprises"><span class="secno">7.3</span> <span class="content">Surprises</span></a>
      <li><a href="#prefixes"><span class="secno">7.4</span> <span class="content">Prefixes</span></a>
      <li><a href="#url-scoping"><span class="secno">7.5</span> <span class="content">URL scoping</span></a>
      <li><a href="#aversion"><span class="secno">7.6</span> <span class="content">Cookie aversion</span></a>
     </ol>
    <li><a href="#acknowledgements"><span class="secno">8</span> <span class="content">Acknowledgements</span></a>
    <li><a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
      <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
     </ol>
    <li><a href="#idl-index"><span class="secno"></span> <span class="content">IDL Index</span></a>
    <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
   </ol>
  </nav>
  <main>
   <p><img alt="logo" src="logo-cookies.svg" style="height: 100px; width: 100px; position: absolute; right: 20px; top: 30px;"></p>
   <h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#intro"></a></h2>
   <p><em>This section is non-normative.</em></p>
   <p>This is a proposal to bring an asynchronous cookie API to scripts running in HTML documents and <a data-link-type="biblio" href="#biblio-service-workers">service workers</a>.</p>
   <p><a data-link-type="biblio" href="#biblio-rfc6265bis">HTTP cookies</a> have, since their origins at Netscape <a href="https://web.archive.org/web/0/http://wp.netscape.com/newsref/std/cookie_spec.html">(documentation preserved by archive.org)</a>, provided a <a href="https://montulli.blogspot.com/2013/05/the-reasoning-behind-web-cookies.html">valuable state-management mechanism</a> for the web.</p>
   <p>The synchronous single-threaded script-level <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/dom.html#dom-document-cookie" id="ref-for-dom-document-cookie">document.cookie</a></code> interface to cookies has been a source of <a href="https://lists.w3.org/Archives/Public/public-whatwg-archive/2009Sep/0083.html">complexity and performance woes</a> further exacerbated by the move in many browsers from:</p>
   <ul>
    <li data-md>
     <p>a single browser process,</p>
    <li data-md>
     <p>a single-threaded event loop model, and</p>
    <li data-md>
     <p>no general expectation of responsiveness for scripted event handling while processing cookie operations</p>
   </ul>
   <p>... to the modern web which strives for smoothly responsive high performance:</p>
   <ul>
    <li data-md>
     <p>in multiple browser processes,</p>
    <li data-md>
     <p>with a multithreaded, multiple-event loop model, and</p>
    <li data-md>
     <p>with an expectation of responsiveness on human-reflex time scales.</p>
   </ul>
   <p>On the modern web a cookie operation in one part of a web application cannot block:</p>
   <ul>
    <li data-md>
     <p>the rest of the web application,</p>
    <li data-md>
     <p>the rest of the web origin, or</p>
    <li data-md>
     <p>the browser as a whole.</p>
   </ul>
   <p>Newer parts of the web built in service workers <a href="https://github.com/slightlyoff/ServiceWorker/issues/707">need access to cookies too</a> but cannot use the synchronous, blocking <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/dom.html#dom-document-cookie" id="ref-for-dom-document-cookie①">document.cookie</a></code> interface at all as they both have no <code>document</code> and also cannot block the event loop as that would interfere with handling of unrelated events.</p>
   <h3 class="heading settled" data-level="1.1" id="intro-proposed-change"><span class="secno">1.1. </span><span class="content">A Taste of the Proposed Change</span><a class="self-link" href="#intro-proposed-change"></a></h3>
   <p>Although it is tempting to <a href="https://discourse.wicg.io/t/rethinking-cookies/744">rethink cookies</a> entirely, web sites today continue to rely heavily on them, and the script APIs for using them are largely unchanged over their first decades of usage.</p>
   <p>Today writing a cookie means blocking your event loop while waiting for the browser to synchronously update the cookie jar with a carefully-crafted cookie string in <code>Set-Cookie</code> format:</p>
   <div class="example" id="example-e33babf4">
    <a class="self-link" href="#example-e33babf4"></a> 
<pre class="language-js highlight">document<c- p>.</c->cookie <c- o>=</c->
  <c- t>'__Secure-COOKIENAME=cookie-value'</c-> <c- o>+</c->
  <c- t>'; Path=/'</c-> <c- o>+</c->
  <c- t>'; expires=Fri, 12 Aug 2016 23:05:17 GMT'</c-> <c- o>+</c->
  <c- t>'; Secure'</c-> <c- o>+</c->
  <c- t>'; Domain=example.org'</c-><c- p>;</c->
<c- c1>// now we could assume the write succeeded, but since</c->
<c- c1>// failure is silent it is difficult to tell, so we</c->
<c- c1>// read to see whether the write succeeded</c->
<c- a>var</c-> successRegExp <c- o>=</c->
  <c- sr>/(^|; ?)__Secure-COOKIENAME=cookie-value(;|$)/</c-><c- p>;</c->
<c- k>if</c-> <c- p>(</c->String<c- p>(</c->document<c- p>.</c->cookie<c- p>).</c->match<c- p>(</c->successRegExp<c- p>))</c-> <c- p>{</c->
  console<c- p>.</c->log<c- p>(</c-><c- t>'It worked!'</c-><c- p>);</c->
<c- p>}</c-> <c- k>else</c-> <c- p>{</c->
  console<c- p>.</c->error<c- p>(</c-><c- t>'It did not work, and we do not know why'</c-><c- p>);</c->
<c- p>}</c->
</pre>
   </div>
   <p>What if you could instead write:</p>
   <div class="example" id="example-ac70a48e">
    <a class="self-link" href="#example-ac70a48e"></a> 
<pre class="language-js highlight">cookieStore<c- p>.</c->set<c- p>(</c->
  <c- t>'__Secure-COOKIENAME'</c-><c- p>,</c->
  <c- t>'cookie-value'</c-><c- p>,</c->
  <c- p>{</c->
    expires<c- o>:</c-> Date<c- p>.</c->now<c- p>()</c-> <c- o>+</c-> <c- mi>24</c-><c- o>*</c-><c- mi>60</c-><c- o>*</c-><c- mi>60</c-><c- o>*</c-><c- mi>1000</c-><c- p>,</c->
    domain<c- o>:</c-> <c- t>'example.org'</c->
  <c- p>}).</c->then<c- p>(</c-><c- a>function</c-><c- p>()</c-> <c- p>{</c->
    console<c- p>.</c->log<c- p>(</c-><c- t>'It worked!'</c-><c- p>);</c->
  <c- p>},</c-> <c- a>function</c-><c- p>(</c->reason<c- p>)</c-> <c- p>{</c->
    console<c- p>.</c->error<c- p>(</c->
      <c- t>'It did not work, and this is why:'</c-><c- p>,</c->
      reason<c- p>);</c->
  <c- p>});</c->
<c- c1>// Meanwhile we can do other things while waiting for</c->
<c- c1>// the cookie store to process the write...</c->
</pre>
   </div>
   <p>This also has the advantage of not relying on <code>document</code> and not blocking, which together make it usable from <a data-link-type="biblio" href="#biblio-service-workers">Service Workers</a>, which otherwise do not have cookie access from script.</p>
   <p>This proposal also includes a power-efficient monitoring API to replace <code>setTimeout</code>-based polling cookie monitors with cookie change observers.</p>
   <h3 class="heading settled" data-level="1.2" id="intro-summary"><span class="secno">1.2. </span><span class="content">Summary</span><a class="self-link" href="#intro-summary"></a></h3>
   <p>This proposal outlines an asynchronous API using Promises/async functions for the following cookie operations:</p>
   <ul>
    <li data-md>
     <p><a href="#intro-modify">write</a> (or "set") and delete (or "expire") cookies</p>
    <li data-md>
     <p><a href="#intro-query">read</a> (or "get") <a data-link-type="dfn" href="#script-visible" id="ref-for-script-visible">script-visible</a> cookies</p>
     <ul>
      <li data-md>
       <p>... including for specified in-scope request paths in <a data-link-type="biblio" href="#biblio-service-workers">service worker</a> contexts</p>
     </ul>
    <li data-md>
     <p><a href="#intro-monitor">monitor</a> <a data-link-type="dfn" href="#script-visible" id="ref-for-script-visible①">script-visible</a> cookies for changes using <code>CookieChangeEvent</code></p>
     <ul>
      <li data-md>
       <p>... in long-running script contexts (e.g. <code>document</code>)</p>
      <li data-md>
       <p>... after registration during the <code>InstallEvent</code> in ephemeral <a data-link-type="biblio" href="#biblio-service-workers">service worker</a> contexts</p>
      <li data-md>
       <p>... again including for script-supplied in-scope request paths
in <a data-link-type="biblio" href="#biblio-service-workers">service worker</a> contexts</p>
     </ul>
   </ul>
   <h4 class="heading settled" data-level="1.2.1" id="script-visibility"><span class="secno">1.2.1. </span><span class="content">Script visibility</span><a class="self-link" href="#script-visibility"></a></h4>
   <p>A cookie is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="script-visible">script-visible</dfn> when it is in-scope and does not have the <code>HttpOnly</code> cookie flag.</p>
   <h4 class="heading settled" data-level="1.2.2" id="intro-motivation"><span class="secno">1.2.2. </span><span class="content">Motivations</span><a class="self-link" href="#intro-motivation"></a></h4>
   <p>Some service workers <a href="https://github.com/slightlyoff/ServiceWorker/issues/707">need access to cookies</a> but
cannot use the synchronous, blocking <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/dom.html#dom-document-cookie" id="ref-for-dom-document-cookie②">document.cookie</a></code> interface as they both have no <code>document</code> and
also cannot block the event loop as that would interfere with handling of unrelated events.</p>
   <p>A new API may also provide a rare and valuable chance to address
some <a href="https://github.com/inikulin/cookie-compat">outstanding cross-browser incompatibilities</a> and bring <a href="https://github.com/whatwg/html/issues/804">divergent
specs and user-agent behavior</a> into closer correspondence.</p>
   <p>A well-designed and opinionated API may actually make cookies easier to deal with correctly from
scripts, with the potential effect of reducing their accidental misuse. An efficient monitoring API, in particular,
can be used to replace power-hungry polling cookie scanners.</p>
   <p>The API must interoperate well enough with existing cookie APIs (HTTP-level, HTML-level and script-level) that it can be adopted incrementally by a large or complex website.</p>
   <h4 class="heading settled" data-level="1.2.3" id="intro-opinions"><span class="secno">1.2.3. </span><span class="content">Opinions</span><a class="self-link" href="#intro-opinions"></a></h4>
   <p>This API defaults cookie paths to <code>/</code> for cookie write operations, including deletion/expiration. The implicit relative path-scoping of cookies to <code>.</code> has caused a lot of additional complexity for relatively little gain given their security equivalence under the same-origin policy and the difficulties arising from multiple same-named cookies at overlapping paths on the same domain. Cookie paths without a trailing <code>/</code> are treated as if they had a trailing <code>/</code> appended for cookie write operations. Cookie paths must start with <code>/</code> for write operations, and must not contain any <code>..</code> path segments. Query parameters and URL fragments are not allowed in paths for cookie write operations.</p>
   <p>URLs without a trailing <code>/</code> are treated as if the final path segment had been removed for cookie read operations, including change monitoring. Paths for cookie read operations are resolved relative to the default read cookie path.</p>
   <p>This API defaults cookies to "Secure" when they are written from a secure web origin. This is intended to prevent unintentional leakage to unsecured connections on the same domain. Furthermore it disallows (to the extent permitted by the browser implementation) creation or modification of <code>Secure-</code>flagged cookies from unsecured web origins and enforces special rules for the <a href="https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.3.2">__Host-</a> and <a href="https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.3.1">__Secure-</a> cookie name prefixes.</p>
   <p>This API defaults cookies to "Domain"-less, which in conjunction with "Secure" provides origin-scoped cookie
behavior in most modern browsers. When practical the <code>__Host-</code> cookie name prefix should be used with these cookies so that cooperating browsers origin-scope them.</p>
   <p>Serialization of expiration times for non-session cookies in a special cookie-specific format has proven cumbersome,
so this API allows JavaScript Date objects and numeric timestamps (milliseconds since the beginning of the Unix epoch) to be used instead. The inconsistently-implemented Max-Age parameter is not exposed, although similar functionality is available for the specific case of expiring a cookie.</p>
   <p>Cookies without U+003D (=) <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point">code points</a> in their HTTP Cookie header serialization are treated as having an empty name, consistent with the majority of current browsers. Cookies with an empty name cannot be set using values containing U+003D (=) <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point①">code points</a> as this would result in ambiguous serializations in the majority of current browsers.</p>
   <p>Internationalized cookie usage from scripts has to date been slow and browser-specific due to lack of interoperability because although several major browsers use UTF-8 interpretation for cookie data, historically Safari and browsers based on WinINet have not. This API mandates UTF-8 interpretation for cookies read or written by this API.</p>
   <p>Use of cookie-change-driven scripts has been hampered by the absence of a power-efficient (non-polling) API for this. This API provides observers for efficient monitoring in document contexts and interest registration for efficient monitoring in service worker contexts.</p>
   <p>Scripts should not have to write and then read "test cookies" to determine whether script-initiated cookie write access is possible, nor should they have to correlate with cooperating server-side versions of the same write-then-read test to determine that script-initiated cookie read access is impossible despite cookies working at the HTTP level.</p>
   <h4 class="heading settled" data-level="1.2.4" id="intro-compat"><span class="secno">1.2.4. </span><span class="content">Compatiblity</span><a class="self-link" href="#intro-compat"></a></h4>
   <p>Some user-agents implement non-standard extensions to cookie behavior. The intent of this specification,
though, is to first capture a useful and interoperable (or mostly-interoperable) subset of cookie behavior implemented
across modern browsers. As new cookie features are specified and adopted it is expected that this API will be
extended to include them. A secondary goal is to converge with <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/dom.html#dom-document-cookie" id="ref-for-dom-document-cookie③">document.cookie</a></code> behavior
and the http cookie specification. See https://github.com/whatwg/html/issues/804 and https://inikulin.github.io/cookie-compat/
for the current state of this convergence.</p>
   <p>Differences across browsers in how bytes outside the printable-ASCII subset are interpreted has led to
long-lasting user- and developer-visible incompatibilities across browsers making internationalized use of cookies
needlessly cumbersome. This API requires UTF-8 interpretation of cookie data and uses <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString">USVString</a></code> for the script interface,
with the additional side-effects that subsequent uses of <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/dom.html#dom-document-cookie" id="ref-for-dom-document-cookie④">document.cookie</a></code> to read a cookie read or written through this interface and subsequent uses of <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/dom.html#dom-document-cookie" id="ref-for-dom-document-cookie⑤">document.cookie</a></code> to update a cookie previously read or written through this interface will also use a UTF-8 interpretation of the cookie data. In practice this
will change the behavior of <code>WinINet</code>-based user agents and Safari but should bring their behavior into concordance
with other modern user agents.</p>
   <h3 class="heading settled" data-level="1.3" id="intro-query"><span class="secno">1.3. </span><span class="content">Querying Cookies</span><a class="self-link" href="#intro-query"></a></h3>
   <p>Both <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document" id="ref-for-concept-document">documents</a> and <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker" id="ref-for-dfn-service-worker">service workers</a> access the same query API, via the <code class="idl"><a data-link-type="idl" href="#dom-window-cookiestore" id="ref-for-dom-window-cookiestore">cookieStore</a></code> property on the <a href="#globals">global object</a>.</p>
   <p>The <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-get-options" id="ref-for-dom-cookiestore-get-options">get()</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-getall-options" id="ref-for-dom-cookiestore-getall-options">getAll()</a></code> methods on <code class="idl"><a data-link-type="idl" href="#cookiestore" id="ref-for-cookiestore">CookieStore</a></code> are used to query cookies.
Both methods return <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-promise-objects" id="ref-for-sec-promise-objects">promises</a>.
Both methods take the same arguments, which can be either:</p>
   <ul>
    <li data-md>
     <p>a name, or</p>
    <li data-md>
     <p>a optional dictionary of options</p>
   </ul>
   <p>The <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-get-options" id="ref-for-dom-cookiestore-get-options①">get()</a></code> method is essentially a form of <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-getall-options" id="ref-for-dom-cookiestore-getall-options①">getAll()</a></code> that only returns the first result.</p>
   <div class="example" id="example-75b57f43">
    <a class="self-link" href="#example-75b57f43"></a> Reading a cookie: 
<pre class="language-js highlight"><c- k>try</c-> <c- p>{</c->
  <c- kr>const</c-> cookie <c- o>=</c-> await cookieStore<c- p>.</c->get<c- p>(</c-><c- t>'session_id'</c-><c- p>);</c->
  <c- k>if</c-> <c- p>(</c->cookie<c- p>)</c-> <c- p>{</c->
    console<c- p>.</c->log<c- p>(</c-><c- sb>`Found </c-><c- si>${</c->cookie<c- p>.</c->name<c- si>}</c-><c- sb> cookie: </c-><c- si>${</c->cookie<c- p>.</c->value<c- si>}</c-><c- sb>`</c-><c- p>);</c->
  <c- p>}</c-> <c- k>else</c-> <c- p>{</c->
    console<c- p>.</c->log<c- p>(</c-><c- t>'Cookie not found'</c-><c- p>);</c->
  <c- p>}</c->
<c- p>}</c-> <c- k>catch</c-> <c- p>(</c->e<c- p>)</c-> <c- p>{</c->
  console<c- p>.</c->error<c- p>(</c-><c- sb>`Cookie store error: </c-><c- si>${</c->e<c- si>}</c-><c- sb>`</c-><c- p>);</c->
<c- p>}</c->
</pre>
   </div>
   <div class="example" id="example-c8309e80">
    <a class="self-link" href="#example-c8309e80"></a> Reading multiple cookies: 
<pre class="language-js highlight"><c- k>try</c-> <c- p>{</c->
  <c- kr>const</c-> cookies <c- o>=</c-> await cookieStore<c- p>.</c->getAll<c- p>({</c->
    name<c- o>:</c-> <c- t>'session_'</c-><c- p>,</c->
    matchType<c- o>:</c-> <c- t>'starts-with'</c-><c- p>,</c->
  <c- p>});</c->
  <c- k>for</c-> <c- p>(</c-><c- kr>const</c-> cookie <c- k>of</c-> cookies<c- p>)</c->
    console<c- p>.</c->log<c- p>(</c-><c- sb>`Result: </c-><c- si>${</c->cookie<c- p>.</c->name<c- si>}</c-><c- sb> = </c-><c- si>${</c->cookie<c- p>.</c->value<c- si>}</c-><c- sb>`</c-><c- p>);</c->
<c- p>}</c-> <c- k>catch</c-> <c- p>(</c->e<c- p>)</c-> <c- p>{</c->
  console<c- p>.</c->error<c- p>(</c-><c- sb>`Cookie store error: </c-><c- si>${</c->e<c- si>}</c-><c- sb>`</c-><c- p>);</c->
<c- p>}</c->
</pre>
   </div>
   <p><a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker" id="ref-for-dfn-service-worker①">Service workers</a> can obtain the list of cookies that would be sent by a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch">fetch</a> to
any URL under their <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-scope-url" id="ref-for-dfn-scope-url">scope</a>.</p>
   <div class="example" id="example-2f07df9d">
    <a class="self-link" href="#example-2f07df9d"></a> Read the cookies for a specific URL (in a <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker" id="ref-for-dfn-service-worker②">service worker</a>): 
<pre class="language-js highlight">await cookieStore<c- p>.</c->getAll<c- p>({</c->url<c- o>:</c-> <c- t>'/admin'</c-><c- p>});</c->
</pre>
   </div>
   <p><a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document" id="ref-for-concept-document①">Documents</a> can only obtain the cookies at their current URL. In other words,
the only valid <code class="idl"><a data-link-type="idl" href="#dom-cookiestoregetoptions-url" id="ref-for-dom-cookiestoregetoptions-url">url</a></code> value in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document" id="ref-for-concept-document②">Document</a> contexts is the document’s URL.</p>
   <p>The objects returned by <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-get-options" id="ref-for-dom-cookiestore-get-options②">get()</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-getall-options" id="ref-for-dom-cookiestore-getall-options②">getAll()</a></code> contain all the relevant information in the cookie store, not just the <a data-link-type="dfn" href="#cookie-name" id="ref-for-cookie-name">name</a> and the <a data-link-type="dfn" href="#cookie-value" id="ref-for-cookie-value">value</a> as in the older <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/dom.html#dom-document-cookie" id="ref-for-dom-document-cookie⑥">document.cookie</a></code> API.</p>
   <div class="example" id="example-74bb82cb">
    <a class="self-link" href="#example-74bb82cb"></a> Accessing all the cookie data: 
<pre class="language-js highlight">await cookie <c- o>=</c-> cookieStore<c- p>.</c->get<c- p>(</c-><c- t>'session_id'</c-><c- p>);</c->
console<c- p>.</c->log<c- p>(</c-><c- sb>`Cookie scope - Domain: </c-><c- si>${</c->cookie<c- p>.</c->domain<c- si>}</c-><c- sb> Path: </c-><c- si>${</c->cookie<c- p>.</c->path<c- si>}</c-><c- sb>`</c-><c- p>);</c->
<c- k>if</c-> <c- p>(</c->cookie<c- p>.</c->expires <c- o>===</c-> <c- kc>null</c-><c- p>)</c-> <c- p>{</c->
  console<c- p>.</c->log<c- p>(</c-><c- t>'Cookie expires at the end of the session'</c-><c- p>);</c->
<c- p>}</c-> <c- k>else</c-> <c- p>{</c->
  console<c- p>.</c->log<c- p>(</c-><c- sb>`Cookie expires at: </c-><c- si>${</c->cookie<c- p>.</c->expires<c- si>}</c-><c- sb>`</c-><c- p>);</c->
<c- p>}</c->
<c- k>if</c-> <c- p>(</c->cookie<c- p>.</c->secure<c- p>)</c->
  console<c- p>.</c->log<c- p>(</c-><c- t>'The cookie is restricted to secure origins'</c-><c- p>);</c->
</pre>
   </div>
   <h3 class="heading settled" data-level="1.4" id="intro-modify"><span class="secno">1.4. </span><span class="content">Modifying Cookies</span><a class="self-link" href="#intro-modify"></a></h3>
   <p>Both <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document" id="ref-for-concept-document③">documents</a> and <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker" id="ref-for-dfn-service-worker③">service workers</a> access the same modification API, via the <code class="idl"><a data-link-type="idl" href="#dom-window-cookiestore" id="ref-for-dom-window-cookiestore①">cookieStore</a></code> property on the <a href="#globals">global object</a>.</p>
   <p>Cookies are created or modified (written) using the <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-set" id="ref-for-dom-cookiestore-set">set()</a></code> method.</p>
   <div class="example" id="example-818b011d">
    <a class="self-link" href="#example-818b011d"></a> Write a cookie: 
<pre class="language-js highlight"><c- k>try</c-> <c- p>{</c->
  await cookieStore<c- p>.</c->set<c- p>(</c-><c- t>'opted_out'</c-><c- p>,</c-> <c- t>'1'</c-><c- p>);</c->
<c- p>}</c-> <c- k>catch</c-> <c- p>(</c->e<c- p>)</c-> <c- p>{</c->
  console<c- p>.</c->error<c- p>(</c-><c- sb>`Failed to set cookie: </c-><c- si>${</c->e<c- si>}</c-><c- sb>`</c-><c- p>);</c->
<c- p>}</c->
</pre>
    <p>The <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-set" id="ref-for-dom-cookiestore-set①">set()</a></code> call above is a shorthand for the following:</p>
<pre class="language-js highlight">await cookieStore<c- p>.</c->set<c- p>({</c->
  name<c- o>:</c-> <c- t>'opted_out'</c-><c- p>,</c->
  value<c- o>:</c-> <c- t>'1'</c-><c- p>,</c->
  expires<c- o>:</c-> <c- kc>null</c-><c- p>,</c->  <c- c1>// session cookie</c->

  <c- c1>// By default, cookies are scoped at the current domain.</c->
  domain<c- o>:</c-> <c- p>(</c-><c- k>new</c-> URL<c- p>(</c->self<c- p>.</c->location<c- p>.</c->href<c- p>)).</c->hostname<c- p>,</c->
  path<c- o>:</c-> <c- t>'/'</c-><c- p>,</c->

  <c- c1>// Creates secure cookies by default on secure origins.</c->
  secure<c- o>:</c-> <c- kc>true</c-><c- p>,</c->
<c- p>});</c->
</pre>
   </div>
   <p>Cookies are deleted (expired) using the <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-delete" id="ref-for-dom-cookiestore-delete">delete()</a></code> method.</p>
   <div class="example" id="example-7990c896">
    <a class="self-link" href="#example-7990c896"></a> Delete a cookie: 
<pre class="language-js highlight"><c- k>try</c-> <c- p>{</c->
  await cookieStore<c- p>.</c-><c- k>delete</c-><c- p>(</c-><c- t>'session_id'</c-><c- p>);</c->
<c- p>}</c-> <c- k>catch</c-> <c- p>(</c->e<c- p>)</c-> <c- p>{</c->
  console<c- p>.</c->error<c- p>(</c-><c- sb>`Failed to delete cookie: </c-><c- si>${</c->e<c- si>}</c-><c- sb>`</c-><c- p>);</c->
<c- p>}</c->
</pre>
   </div>
   <p>Under the hood, deleting a cookie is done by changing the cookie’s expiration date to the past, which still works.</p>
   <div class="example" id="example-5614708e">
    <a class="self-link" href="#example-5614708e"></a> Deleting a cookie by changing the expiry date: 
<pre class="language-js highlight"><c- k>try</c-> <c- p>{</c->
  <c- kr>const</c-> one_day_ms <c- o>=</c-> <c- mi>24</c-> <c- o>*</c-> <c- mi>60</c-> <c- o>*</c-> <c- mi>60</c-> <c- o>*</c-> <c- mi>1000</c-><c- p>;</c->
  await cookieStore<c- p>.</c->set<c- p>(</c-><c- t>'session_id'</c-><c- p>,</c-> <c- t>'value will be ignored'</c-><c- p>,</c->
                        <c- p>{</c-> expires<c- o>:</c-> Date<c- p>.</c->now<c- p>()</c-> <c- o>-</c-> one_day_ms <c- p>});</c->
<c- p>}</c-> <c- k>catch</c-> <c- p>(</c->e<c- p>)</c-> <c- p>{</c->
  console<c- p>.</c->error<c- p>(</c-><c- sb>`Failed to delete cookie: </c-><c- si>${</c->e<c- si>}</c-><c- sb>`</c-><c- p>);</c->
<c- p>}</c->
</pre>
   </div>
   <h3 class="heading settled" data-level="1.5" id="intro-monitor"><span class="secno">1.5. </span><span class="content">Monitoring Cookies</span><a class="self-link" href="#intro-monitor"></a></h3>
   <p>To avoid polling, it is possible to observe changes to cookies.</p>
   <p>In <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document" id="ref-for-concept-document④">documents</a>, <code>change</code> events are fired for all relevant cookie changes.</p>
   <div class="example" id="example-7e599641">
    <a class="self-link" href="#example-7e599641"></a> Register for <code>change</code> events in documents: 
<pre class="language-js highlight">cookieStore<c- p>.</c->addEventListener<c- p>(</c-><c- t>'change'</c-><c- p>,</c-> event <c- p>=></c-> <c- p>{</c->
  console<c- p>.</c->log<c- p>(</c-><c- sb>`</c-><c- si>${</c->event<c- p>.</c->changed<c- p>.</c->length<c- si>}</c-><c- sb> changed cookies`</c-><c- p>);</c->
  <c- k>for</c-> <c- p>(</c-><c- kr>const</c-> cookie <c- k>in</c-> event<c- p>.</c->changed<c- p>)</c->
    console<c- p>.</c->log<c- p>(</c-><c- sb>`Cookie </c-><c- si>${</c->cookie<c- p>.</c->name<c- si>}</c-><c- sb> changed to </c-><c- si>${</c->cookie<c- p>.</c->value<c- si>}</c-><c- sb>`</c-><c- p>);</c->

console<c- p>.</c->log<c- p>(</c-><c- sb>`</c-><c- si>${</c->event<c- p>.</c->deleted<c- p>.</c->length<c- si>}</c-><c- sb> deleted cookies`</c-><c- p>);</c->
  <c- k>for</c-> <c- p>(</c-><c- kr>const</c-> cookie <c- k>in</c-> event<c- p>.</c->deleted<c- p>)</c->
    console<c- p>.</c->log<c- p>(</c-><c- sb>`Cookie </c-><c- si>${</c->cookie<c- p>.</c->name<c- si>}</c-><c- sb> deleted`</c-><c- p>);</c->
<c- p>});</c->
</pre>
   </div>
   <p><a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker" id="ref-for-dfn-service-worker④">Service workers</a> have to subscribe for events during the <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-state" id="ref-for-dfn-state">install</a> stage,
and start receiving <code>cookiechange</code> events when <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-state" id="ref-for-dfn-state①">activated</a>.</p>
   <div class="example" id="example-854f2a11">
    <a class="self-link" href="#example-854f2a11"></a> Register for <code>cookiechange</code> events in a service worker: 
<pre class="language-js highlight">self<c- p>.</c->addEventListener<c- p>(</c-><c- t>'install'</c-><c- p>,</c-> event <c- p>=></c-> <c- p>{</c->
  event<c- p>.</c->waitFor<c- p>(</c->async <c- p>()</c-> <c- p>=></c-> <c- p>{</c->
    await cookieStore<c- p>.</c->subscribeToChanges<c- p>([{</c->
      name<c- o>:</c-> <c- t>'session'</c-><c- p>,</c->  <c- c1>// Get change events for session-related cookies.</c->
      matchType<c- o>:</c-> <c- t>'starts-with'</c-><c- p>,</c->  <c- c1>// Matches session_id, session-id, etc.</c->
    <c- p>}]);</c->
  <c- p>});</c->
<c- p>});</c->

self<c- p>.</c->addEventListener<c- p>(</c-><c- t>'cookiechange'</c-><c- p>,</c-> event <c- p>=></c-> <c- p>{</c->
  <c- c1>// The event has |changed| and |deleted| properties with</c->
  <c- c1>// the same semantics as the Document events.</c->
  console<c- p>.</c->log<c- p>(</c-><c- sb>`</c-><c- si>${</c->event<c- p>.</c->changed<c- p>.</c->length<c- si>}</c-><c- sb> changed cookies`</c-><c- p>);</c->
  console<c- p>.</c->log<c- p>(</c-><c- sb>`</c-><c- si>${</c->event<c- p>.</c->deleted<c- p>.</c->length<c- si>}</c-><c- sb> deleted cookies`</c-><c- p>);</c->
<c- p>});</c->
</pre>
   </div>
   <p>Calls to <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-subscribetochanges" id="ref-for-dom-cookiestore-subscribetochanges">subscribeToChanges()</a></code> are cumulative, so that independently maintained
modules or libraries can set up their own subscriptions. As expected, a <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker" id="ref-for-dfn-service-worker⑤">service worker</a>'s
subscriptions are persisted for with the <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration">service worker registration</a>.</p>
   <p>Subscriptions can use the same options as <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-get-options" id="ref-for-dom-cookiestore-get-options③">get()</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-getall-options" id="ref-for-dom-cookiestore-getall-options③">getAll()</a></code>.
The complexity of fine-grained subscriptions is justified
by the cost of dispatching an irrelevant cookie change event to a <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker" id="ref-for-dfn-service-worker⑥">service worker</a>,
which is is much higher than the cost of dispatching an equivalent event
to a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-window" id="ref-for-concept-request-window">window</a>. Specifically, dispatching an event to a <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker" id="ref-for-dfn-service-worker⑦">service worker</a> might
require waking up the worker, which has a significant impact on battery life.</p>
   <p>The <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-getchangesubscriptions" id="ref-for-dom-cookiestore-getchangesubscriptions">getChangeSubscriptions()</a></code> allows a <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker" id="ref-for-dfn-service-worker⑧">service worker</a> to introspect
the subscriptions that have been made.</p>
   <div class="example" id="example-ef0cb9c6">
    <a class="self-link" href="#example-ef0cb9c6"></a> Checking change subscriptions: 
<pre class="language-js highlight">   <c- kr>const</c-> subscriptions <c- o>=</c-> await cookieStore<c- p>.</c->getChangeSubscriptions<c- p>();</c->
   <c- k>for</c-> <c- p>(</c-><c- kr>const</c-> sub <c- k>of</c-> subscriptions<c- p>)</c-> <c- p>{</c->
     console<c- p>.</c->log<c- p>(</c->sub<c- p>.</c->name<c- p>,</c-> sub<c- p>.</c->url<c- p>,</c-> sub<c- p>.</c->matchType<c- p>);</c->
   <c- p>}</c->
</pre>
   </div>
   <h2 class="heading settled" data-level="2" id="concepts"><span class="secno">2. </span><span class="content">Concepts</span><a class="self-link" href="#concepts"></a></h2>
   <h3 class="heading settled" data-level="2.1" id="cookie-concept"><span class="secno">2.1. </span><span class="content">Cookie</span><a class="self-link" href="#cookie-concept"></a></h3>
   <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="cookie">cookie</dfn> is normatively defined for user agents by <a href="https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-5">Cookies: HTTP State Management Mechanism §User Agent Requirements</a>.</p>
   <div> Per <a href="https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-5.4">Cookies: HTTP State Management Mechanism §Storage Model</a>, a <a data-link-type="dfn" href="#cookie" id="ref-for-cookie">cookie</a> has the following fields: <dfn class="dfn-paneled" data-dfn-for="cookie" data-dfn-type="dfn" data-noexport id="cookie-name">name</dfn>, <dfn class="dfn-paneled" data-dfn-for="cookie" data-dfn-type="dfn" data-noexport id="cookie-value">value</dfn>, <dfn class="dfn-paneled" data-dfn-for="cookie" data-dfn-type="dfn" data-noexport id="cookie-expiry-time">expiry-time</dfn>, <dfn class="dfn-paneled" data-dfn-for="cookie" data-dfn-type="dfn" data-noexport id="cookie-domain">domain</dfn>, <dfn class="dfn-paneled" data-dfn-for="cookie" data-dfn-type="dfn" data-noexport id="cookie-path">path</dfn>, <dfn class="dfn-paneled" data-dfn-for="cookie" data-dfn-type="dfn" data-noexport id="cookie-creation-time">creation-time</dfn>, <dfn class="dfn-paneled" data-dfn-for="cookie" data-dfn-type="dfn" data-noexport id="cookie-last-access-time">last-access-time</dfn>, <dfn class="dfn-paneled" data-dfn-for="cookie" data-dfn-type="dfn" data-noexport id="cookie-persistent-flag">persistent-flag</dfn>, <dfn class="dfn-paneled" data-dfn-for="cookie" data-dfn-type="dfn" data-noexport id="cookie-host-only-flag">host-only-flag</dfn>, <dfn class="dfn-paneled" data-dfn-for="cookie" data-dfn-type="dfn" data-noexport id="cookie-secure-only-flag">secure-only-flag</dfn>, <dfn class="dfn-paneled" data-dfn-for="cookie" data-dfn-type="dfn" data-noexport id="cookie-http-only-flag">http-only-flag</dfn>, <dfn class="dfn-paneled" data-dfn-for="cookie" data-dfn-type="dfn" data-noexport id="cookie-same-site-flag">same-site-flag</dfn>. </div>
   <h3 class="heading settled" data-level="2.2" id="cookie-store--concept"><span class="secno">2.2. </span><span class="content">Cookie Store</span><a class="self-link" href="#cookie-store--concept"></a></h3>
   <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="cookie-store">cookie store</dfn> is normatively defined for user agents by <a data-link-type="biblio" href="#biblio-rfc6265bis">Cookies: HTTP State Management Mechanism §User Agent Requirements</a>.</p>
   <p>When any of the following conditions occur for a <a data-link-type="dfn" href="#cookie-store" id="ref-for-cookie-store">cookie store</a>, perform the steps to <a data-link-type="dfn" href="#process-cookie-changes" id="ref-for-process-cookie-changes">process cookie changes</a>.</p>
   <ul>
    <li data-md>
     <p>A newly-created <a data-link-type="dfn" href="#cookie" id="ref-for-cookie①">cookie</a> is inserted into the <a data-link-type="dfn" href="#cookie-store" id="ref-for-cookie-store①">cookie store</a>.</p>
    <li data-md>
     <p>A user agent evicts expired <a data-link-type="dfn" href="#cookie" id="ref-for-cookie②">cookies</a> from the <a data-link-type="dfn" href="#cookie-store" id="ref-for-cookie-store②">cookie store</a>.</p>
    <li data-md>
     <p>A user agent removes excess <a data-link-type="dfn" href="#cookie" id="ref-for-cookie③">cookies</a> from the <a data-link-type="dfn" href="#cookie-store" id="ref-for-cookie-store③">cookie store</a>.</p>
   </ul>
   <p class="issue" id="issue-30ac9b7d"><a class="self-link" href="#issue-30ac9b7d"></a> How about when "the current session is over" for non-persistent cookies?</p>
   <h3 class="heading settled" data-level="2.3" id="service-worker-extensions"><span class="secno">2.3. </span><span class="content">Extensions to Service Worker</span><a class="self-link" href="#service-worker-extensions"></a></h3>
   <p><a data-link-type="biblio" href="#biblio-service-workers">[Service-Workers]</a> defines <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration①">service worker registration</a>, which this specification extends.</p>
   <p>A <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration②">service worker registration</a> has an associated <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="cookie-change-subscription-list">cookie change subscription list</dfn> which is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list">list</a>;
each member is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="cookie-change-subscription">cookie change subscription</dfn>. A <a data-link-type="dfn" href="#cookie-change-subscription" id="ref-for-cookie-change-subscription">cookie change subscription</a> is <span> a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple">tuple</a> of <dfn class="dfn-paneled" data-dfn-for="cookie change subscription" data-dfn-type="dfn" data-noexport id="cookie-change-subscription-name">name</dfn>, <dfn class="dfn-paneled" data-dfn-for="cookie change subscription" data-dfn-type="dfn" data-noexport id="cookie-change-subscription-url">url</dfn>, and <dfn class="dfn-paneled" data-dfn-for="cookie change subscription" data-dfn-type="dfn" data-noexport id="cookie-change-subscription-matchtype">matchType</dfn>. </span></p>
   <h2 class="heading settled" data-level="3" id="CookieStore"><span class="secno">3. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#cookiestore" id="ref-for-cookiestore①">CookieStore</a></code> Interface</span><a class="self-link" href="#CookieStore"></a></h2>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed"><c- g>Exposed</c-></a>=(<c- n>ServiceWorker</c->,<c- n>Window</c->),
 <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="cookiestore"><code><c- g>CookieStore</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget"><c- n>EventTarget</c-></a> {
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-cookielistitem" id="ref-for-dictdef-cookielistitem"><c- n>CookieListItem</c-></a>?> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-get" id="ref-for-dom-cookiestore-get"><c- g>get</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①"><c- b>USVString</c-></a> <dfn class="idl-code" data-dfn-for="CookieStore/get(name)" data-dfn-type="argument" data-export id="dom-cookiestore-get-name-name"><code><c- g>name</c-></code><a class="self-link" href="#dom-cookiestore-get-name-name"></a></dfn>);
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-cookielistitem" id="ref-for-dictdef-cookielistitem①"><c- n>CookieListItem</c-></a>?> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-get-options" id="ref-for-dom-cookiestore-get-options④"><c- g>get</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cookiestoregetoptions" id="ref-for-dictdef-cookiestoregetoptions"><c- n>CookieStoreGetOptions</c-></a> <dfn class="idl-code" data-dfn-for="CookieStore/get(options), CookieStore/get()" data-dfn-type="argument" data-export id="dom-cookiestore-get-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-cookiestore-get-options-options"></a></dfn> = {});

  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist"><c- n>CookieList</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-getall" id="ref-for-dom-cookiestore-getall"><c- g>getAll</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString②"><c- b>USVString</c-></a> <dfn class="idl-code" data-dfn-for="CookieStore/getAll(name)" data-dfn-type="argument" data-export id="dom-cookiestore-getall-name-name"><code><c- g>name</c-></code><a class="self-link" href="#dom-cookiestore-getall-name-name"></a></dfn>);
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist①"><c- n>CookieList</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-getall-options" id="ref-for-dom-cookiestore-getall-options④"><c- g>getAll</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cookiestoregetoptions" id="ref-for-dictdef-cookiestoregetoptions①"><c- n>CookieStoreGetOptions</c-></a> <dfn class="idl-code" data-dfn-for="CookieStore/getAll(options), CookieStore/getAll()" data-dfn-type="argument" data-export id="dom-cookiestore-getall-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-cookiestore-getall-options-options"></a></dfn> = {});

  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-set" id="ref-for-dom-cookiestore-set②"><c- g>set</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString③"><c- b>USVString</c-></a> <dfn class="idl-code" data-dfn-for="CookieStore/set(name, value, options), CookieStore/set(name, value)" data-dfn-type="argument" data-export id="dom-cookiestore-set-name-value-options-name"><code><c- g>name</c-></code><a class="self-link" href="#dom-cookiestore-set-name-value-options-name"></a></dfn>, <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString④"><c- b>USVString</c-></a> <dfn class="idl-code" data-dfn-for="CookieStore/set(name, value, options), CookieStore/set(name, value)" data-dfn-type="argument" data-export id="dom-cookiestore-set-name-value-options-value"><code><c- g>value</c-></code><a class="self-link" href="#dom-cookiestore-set-name-value-options-value"></a></dfn>,
                    <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cookiestoresetoptions" id="ref-for-dictdef-cookiestoresetoptions"><c- n>CookieStoreSetOptions</c-></a> <dfn class="idl-code" data-dfn-for="CookieStore/set(name, value, options), CookieStore/set(name, value)" data-dfn-type="argument" data-export id="dom-cookiestore-set-name-value-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-cookiestore-set-name-value-options-options"></a></dfn> = {});
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-set-options" id="ref-for-dom-cookiestore-set-options"><c- g>set</c-></a>(<a class="n" data-link-type="idl-name" href="#dictdef-cookiestoresetextraoptions" id="ref-for-dictdef-cookiestoresetextraoptions"><c- n>CookieStoreSetExtraOptions</c-></a> <dfn class="idl-code" data-dfn-for="CookieStore/set(options)" data-dfn-type="argument" data-export id="dom-cookiestore-set-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-cookiestore-set-options-options"></a></dfn>);

  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-delete" id="ref-for-dom-cookiestore-delete①"><c- g>delete</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑤"><c- b>USVString</c-></a> <dfn class="idl-code" data-dfn-for="CookieStore/delete(name)" data-dfn-type="argument" data-export id="dom-cookiestore-delete-name-name"><code><c- g>name</c-></code><a class="self-link" href="#dom-cookiestore-delete-name-name"></a></dfn>);
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-delete-options" id="ref-for-dom-cookiestore-delete-options"><c- g>delete</c-></a>(<a class="n" data-link-type="idl-name" href="#dictdef-cookiestoredeleteoptions" id="ref-for-dictdef-cookiestoredeleteoptions"><c- n>CookieStoreDeleteOptions</c-></a> <dfn class="idl-code" data-dfn-for="CookieStore/delete(options)" data-dfn-type="argument" data-export id="dom-cookiestore-delete-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-cookiestore-delete-options-options"></a></dfn>);

  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-subscribetochanges" id="ref-for-dom-cookiestore-subscribetochanges①"><c- g>subscribeToChanges</c-></a>(<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-cookiestoregetoptions" id="ref-for-dictdef-cookiestoregetoptions②"><c- n>CookieStoreGetOptions</c-></a>> <dfn class="idl-code" data-dfn-for="CookieStore/subscribeToChanges(subscriptions)" data-dfn-type="argument" data-export id="dom-cookiestore-subscribetochanges-subscriptions-subscriptions"><code><c- g>subscriptions</c-></code><a class="self-link" href="#dom-cookiestore-subscribetochanges-subscriptions-subscriptions"></a></dfn>);

  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
  <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-cookiestoregetoptions" id="ref-for-dictdef-cookiestoregetoptions③"><c- n>CookieStoreGetOptions</c-></a>>> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-getchangesubscriptions" id="ref-for-dom-cookiestore-getchangesubscriptions①"><c- g>getChangeSubscriptions</c-></a>();

  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed③"><c- g>Exposed</c-></a>=<c- n>Window</c->]
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler"><c- n>EventHandler</c-></a> <dfn class="idl-code" data-dfn-for="CookieStore" data-dfn-type="attribute" data-export data-type="EventHandler" id="dom-cookiestore-onchange"><code><c- g>onchange</c-></code><a class="self-link" href="#dom-cookiestore-onchange"></a></dfn>;
};

<c- b>enum</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="enum" data-export id="enumdef-cookiematchtype"><code><c- g>CookieMatchType</c-></code></dfn> {
  <dfn class="dfn-paneled idl-code" data-dfn-for="CookieMatchType" data-dfn-type="enum-value" data-export id="dom-cookiematchtype-equals"><code><c- s>"equals"</c-></code></dfn>,
  <dfn class="dfn-paneled idl-code" data-dfn-for="CookieMatchType" data-dfn-type="enum-value" data-export id="dom-cookiematchtype-starts-with"><code><c- s>"starts-with"</c-></code></dfn>
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-cookiestoregetoptions"><code><c- g>CookieStoreGetOptions</c-></code></dfn> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑥"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="CookieStoreGetOptions" data-dfn-type="dict-member" data-export data-type="USVString " id="dom-cookiestoregetoptions-name"><code><c- g>name</c-></code></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑦"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="CookieStoreGetOptions" data-dfn-type="dict-member" data-export data-type="USVString " id="dom-cookiestoregetoptions-url"><code><c- g>url</c-></code></dfn>;
  <a class="n" data-link-type="idl-name" href="#enumdef-cookiematchtype" id="ref-for-enumdef-cookiematchtype"><c- n>CookieMatchType</c-></a> <dfn class="dfn-paneled idl-code" data-default="&quot;equals&quot;" data-dfn-for="CookieStoreGetOptions" data-dfn-type="dict-member" data-export data-type="CookieMatchType " id="dom-cookiestoregetoptions-matchtype"><code><c- g>matchType</c-></code></dfn> = "equals";
};

<c- b>enum</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="enum" data-export id="enumdef-cookiesamesite"><code><c- g>CookieSameSite</c-></code></dfn> {
  <dfn class="dfn-paneled idl-code" data-dfn-for="CookieSameSite" data-dfn-type="enum-value" data-export id="dom-cookiesamesite-strict"><code><c- s>"strict"</c-></code></dfn>,
  <dfn class="dfn-paneled idl-code" data-dfn-for="CookieSameSite" data-dfn-type="enum-value" data-export id="dom-cookiesamesite-lax"><code><c- s>"lax"</c-></code></dfn>,
  <dfn class="dfn-paneled idl-code" data-dfn-for="CookieSameSite" data-dfn-type="enum-value" data-export id="dom-cookiesamesite-none"><code><c- s>"none"</c-></code></dfn>
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-cookiestoresetoptions"><code><c- g>CookieStoreSetOptions</c-></code></dfn> {
  <a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#DOMTimeStamp" id="ref-for-DOMTimeStamp"><c- n>DOMTimeStamp</c-></a>? <dfn class="dfn-paneled idl-code" data-default="null" data-dfn-for="CookieStoreSetOptions" data-dfn-type="dict-member" data-export data-type="DOMTimeStamp? " id="dom-cookiestoresetoptions-expires"><code><c- g>expires</c-></code></dfn> = <c- b>null</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑧"><c- b>USVString</c-></a>? <dfn class="dfn-paneled idl-code" data-default="null" data-dfn-for="CookieStoreSetOptions" data-dfn-type="dict-member" data-export data-type="USVString? " id="dom-cookiestoresetoptions-domain"><code><c- g>domain</c-></code></dfn> = <c- b>null</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑨"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-default="&quot;/&quot;" data-dfn-for="CookieStoreSetOptions" data-dfn-type="dict-member" data-export data-type="USVString " id="dom-cookiestoresetoptions-path"><code><c- g>path</c-></code></dfn> = "/";
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-default="true" data-dfn-for="CookieStoreSetOptions" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-cookiestoresetoptions-secure"><code><c- g>secure</c-></code></dfn> = <c- b>true</c->;
  <a class="n" data-link-type="idl-name" href="#enumdef-cookiesamesite" id="ref-for-enumdef-cookiesamesite"><c- n>CookieSameSite</c-></a> <dfn class="dfn-paneled idl-code" data-default="&quot;strict&quot;" data-dfn-for="CookieStoreSetOptions" data-dfn-type="dict-member" data-export data-type="CookieSameSite " id="dom-cookiestoresetoptions-samesite"><code><c- g>sameSite</c-></code></dfn> = "strict";
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-cookiestoresetextraoptions"><code><c- g>CookieStoreSetExtraOptions</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="#dictdef-cookiestoresetoptions" id="ref-for-dictdef-cookiestoresetoptions①"><c- n>CookieStoreSetOptions</c-></a> {
  <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①⓪"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="CookieStoreSetExtraOptions" data-dfn-type="dict-member" data-export data-type="USVString " id="dom-cookiestoresetextraoptions-name"><code><c- g>name</c-></code></dfn>;
  <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①①"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="CookieStoreSetExtraOptions" data-dfn-type="dict-member" data-export data-type="USVString " id="dom-cookiestoresetextraoptions-value"><code><c- g>value</c-></code></dfn>;
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-cookiestoredeleteoptions"><code><c- g>CookieStoreDeleteOptions</c-></code></dfn> {
  <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①②"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="CookieStoreDeleteOptions" data-dfn-type="dict-member" data-export data-type="USVString " id="dom-cookiestoredeleteoptions-name"><code><c- g>name</c-></code></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①③"><c- b>USVString</c-></a>? <dfn class="dfn-paneled idl-code" data-default="null" data-dfn-for="CookieStoreDeleteOptions" data-dfn-type="dict-member" data-export data-type="USVString? " id="dom-cookiestoredeleteoptions-domain"><code><c- g>domain</c-></code></dfn> = <c- b>null</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①④"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-default="&quot;/&quot;" data-dfn-for="CookieStoreDeleteOptions" data-dfn-type="dict-member" data-export data-type="USVString " id="dom-cookiestoredeleteoptions-path"><code><c- g>path</c-></code></dfn> = "/";
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-cookielistitem"><code><c- g>CookieListItem</c-></code></dfn> {
  <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①⑤"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="CookieListItem" data-dfn-type="dict-member" data-export data-type="USVString " id="dom-cookielistitem-name"><code><c- g>name</c-></code></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①⑥"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="CookieListItem" data-dfn-type="dict-member" data-export data-type="USVString " id="dom-cookielistitem-value"><code><c- g>value</c-></code></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①⑦"><c- b>USVString</c-></a>? <dfn class="dfn-paneled idl-code" data-default="null" data-dfn-for="CookieListItem" data-dfn-type="dict-member" data-export data-type="USVString? " id="dom-cookielistitem-domain"><code><c- g>domain</c-></code></dfn> = <c- b>null</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①⑧"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-default="&quot;/&quot;" data-dfn-for="CookieListItem" data-dfn-type="dict-member" data-export data-type="USVString " id="dom-cookielistitem-path"><code><c- g>path</c-></code></dfn> = "/";
  <a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#DOMTimeStamp" id="ref-for-DOMTimeStamp①"><c- n>DOMTimeStamp</c-></a>? <dfn class="dfn-paneled idl-code" data-default="null" data-dfn-for="CookieListItem" data-dfn-type="dict-member" data-export data-type="DOMTimeStamp? " id="dom-cookielistitem-expires"><code><c- g>expires</c-></code></dfn> = <c- b>null</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-default="true" data-dfn-for="CookieListItem" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-cookielistitem-secure"><code><c- g>secure</c-></code></dfn> = <c- b>true</c->;
  <a class="n" data-link-type="idl-name" href="#enumdef-cookiesamesite" id="ref-for-enumdef-cookiesamesite①"><c- n>CookieSameSite</c-></a> <dfn class="dfn-paneled idl-code" data-default="&quot;strict&quot;" data-dfn-for="CookieListItem" data-dfn-type="dict-member" data-export data-type="CookieSameSite " id="dom-cookielistitem-samesite"><code><c- g>sameSite</c-></code></dfn> = "strict";
};

<c- b>typedef</c-> <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-cookielistitem" id="ref-for-dictdef-cookielistitem②"><c- n>CookieListItem</c-></a>> <dfn class="dfn-paneled idl-code" data-dfn-type="typedef" data-export id="typedefdef-cookielist"><code><c- g>CookieList</c-></code></dfn>;
</pre>
   <h3 class="heading settled" data-level="3.1" id="CookieStore-get"><span class="secno">3.1. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-get-options" id="ref-for-dom-cookiestore-get-options⑤">get()</a></code> method</span><a class="self-link" href="#CookieStore-get"></a></h3>
   <div class="note" role="note">
    <dl class="domintro">
     <dt><var>cookie</var> = await cookieStore . <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-get" id="ref-for-dom-cookiestore-get①">get</a></code>(<var>name</var>) 
     <dt><var>cookie</var> = await cookieStore . <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-get-options" id="ref-for-dom-cookiestore-get-options⑥">get</a></code>(<var>options</var>) 
     <dd> Returns a promise resolving to the first in-scope <a data-link-type="dfn" href="#script-visible" id="ref-for-script-visible②">script-visible</a> value
        for a given cookie name (or other options).
        In a service worker context this defaults to the path of the service worker’s registered scope.
        In a document it defaults to the path of the current document and does not respect changes from <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/history.html#dom-history-replacestate" id="ref-for-dom-history-replacestate">replaceState()</a></code> or <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/origin.html#dom-document-domain" id="ref-for-dom-document-domain">document.domain</a></code>. 
    </dl>
   </div>
   <div class="algorithm">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="CookieStore" data-dfn-type="method" data-export id="dom-cookiestore-get"><code>get(<var>name</var>)</code></dfn> method, when invoked, must run these steps: 
    <ol>
     <li data-md>
      <p>Let <var>origin</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin" id="ref-for-concept-origin">origin</a>.</p>
     <li data-md>
      <p>If <var>origin</var> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque" id="ref-for-concept-origin-opaque">opaque origin</a>, then return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with">a promise rejected with</a> a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror">SecurityError</a></code>" <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException">DOMException</a></code>.</p>
     <li data-md>
      <p>Let <var>url</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object①">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url" id="ref-for-concept-environment-creation-url">creation URL</a>.</p>
     <li data-md>
      <p>Let <var>p</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise">a new promise</a>.</p>
     <li data-md>
      <p>Run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel">in parallel</a>:</p>
      <ol>
       <li data-md>
        <p>Let <var>list</var> be the results of running <a data-link-type="dfn" href="#query-cookies" id="ref-for-query-cookies">query cookies</a> with <var>url</var> and <var>name</var>.</p>
       <li data-md>
        <p>If <var>list</var> is failure, then <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise">reject</a> <var>p</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror">TypeError</a></code> and abort these steps.</p>
       <li data-md>
        <p>If <var>list</var> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-is-empty" id="ref-for-list-is-empty">is empty</a>, then <a data-link-type="dfn">resolve</a> <var>p</var> with undefined.</p>
       <li data-md>
        <p>Otherwise, <a data-link-type="dfn">resolve</a> <var>p</var> with the first item of <var>list</var>.</p>
      </ol>
     <li data-md>
      <p>Return <var>p</var>.</p>
    </ol>
   </div>
   <div class="algorithm">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="CookieStore" data-dfn-type="method" data-export data-lt="get(options)|get()" id="dom-cookiestore-get-options"><code>get(<var>options</var>)</code></dfn> method, when invoked, must run these steps: 
    <ol>
     <li data-md>
      <p>Let <var>origin</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object②">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin" id="ref-for-concept-origin①">origin</a>.</p>
     <li data-md>
      <p>If <var>origin</var> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque" id="ref-for-concept-origin-opaque①">opaque origin</a>, then return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①">a promise rejected with</a> a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror①">SecurityError</a></code>" <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException①">DOMException</a></code>.</p>
     <li data-md>
      <p>Let <var>url</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object③">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url" id="ref-for-concept-environment-creation-url①">creation URL</a>.</p>
     <li data-md>
      <p>If <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoregetoptions-url" id="ref-for-dom-cookiestoregetoptions-url①">url</a></code> dictionary member is present, then run these steps:</p>
      <ol>
       <li data-md>
        <p>Let <var>parsed</var> be the result of <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-basic-url-parser" id="ref-for-concept-basic-url-parser">parsing</a> <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoregetoptions-url" id="ref-for-dom-cookiestoregetoptions-url②">url</a></code> dictionary member with the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object">context object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object">relevant settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url" id="ref-for-api-base-url">API base URL</a>.</p>
       <li data-md>
        <p>If the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-global-object" id="ref-for-current-global-object">current global object</a> is a <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window">Window</a></code> object and <var>parsed</var> does not <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-equals" id="ref-for-concept-url-equals">equal</a> <var>url</var>,
then return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with②">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror①">TypeError</a></code>.</p>
       <li data-md>
        <p>If <var>parsed</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-origin" id="ref-for-concept-url-origin">origin</a> and <var>url</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-origin" id="ref-for-concept-url-origin①">origin</a> are not the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin" id="ref-for-same-origin">same origin</a>,
then return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with③">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror②">TypeError</a></code>.</p>
       <li data-md>
        <p>Set <var>url</var> to <var>parsed</var>.</p>
      </ol>
     <li data-md>
      <p>Let <var>p</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise①">a new promise</a>.</p>
     <li data-md>
      <p>Run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①">in parallel</a>:</p>
      <ol>
       <li data-md>
        <p>Let <var>list</var> be the results of running <a data-link-type="dfn" href="#query-cookies" id="ref-for-query-cookies①">query cookies</a> with <var>url</var>, <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoregetoptions-name" id="ref-for-dom-cookiestoregetoptions-name">name</a></code> dictionary member (if present), and <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoregetoptions-matchtype" id="ref-for-dom-cookiestoregetoptions-matchtype">matchType</a></code> dictionary member.</p>
       <li data-md>
        <p>If <var>list</var> is failure, then <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise①">reject</a> <var>p</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror③">TypeError</a></code> and abort these steps.</p>
       <li data-md>
        <p>If <var>list</var> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-is-empty" id="ref-for-list-is-empty①">is empty</a>, then <a data-link-type="dfn">resolve</a> <var>p</var> with undefined.</p>
       <li data-md>
        <p>Otherwise, <a data-link-type="dfn">resolve</a> <var>p</var> with the first item of <var>list</var>.</p>
      </ol>
     <li data-md>
      <p>Return <var>p</var>.</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="3.2" id="CookieStore-getAll"><span class="secno">3.2. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-getall-options" id="ref-for-dom-cookiestore-getall-options⑤">getAll()</a></code> method</span><a class="self-link" href="#CookieStore-getAll"></a></h3>
   <div class="note" role="note">
    <dl class="domintro">
     <dt><var>cookies</var> = await cookieStore . <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-getall" id="ref-for-dom-cookiestore-getall①">getAll</a></code>(<var>name</var>) 
     <dt><var>cookies</var> = await cookieStore . <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-getall-options" id="ref-for-dom-cookiestore-getall-options⑥">getAll</a></code>(<var>options</var>) 
     <dd>
      <p>Returns a promise resolving to the all in-scope <a data-link-type="dfn" href="#script-visible" id="ref-for-script-visible③">script-visible</a> value
        for a given cookie name (or other options).
        In a service worker context this defaults to the path of the service worker’s registered scope.
        In a document it defaults to the path of the current document and does not respect changes from <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/history.html#dom-history-replacestate" id="ref-for-dom-history-replacestate①">replaceState()</a></code> or <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/origin.html#dom-document-domain" id="ref-for-dom-document-domain①">document.domain</a></code>.</p>
    </dl>
   </div>
   <div class="algorithm">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="CookieStore" data-dfn-type="method" data-export id="dom-cookiestore-getall"><code>getAll(<var>name</var>)</code></dfn> method, when invoked, must run these steps: 
    <ol>
     <li data-md>
      <p>Let <var>origin</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object④">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin" id="ref-for-concept-origin②">origin</a>.</p>
     <li data-md>
      <p>If <var>origin</var> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque" id="ref-for-concept-origin-opaque②">opaque origin</a>, then return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with④">a promise rejected with</a> a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror②">SecurityError</a></code>" <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException②">DOMException</a></code>.</p>
     <li data-md>
      <p>Let <var>url</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object⑤">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url" id="ref-for-concept-environment-creation-url②">creation URL</a>.</p>
     <li data-md>
      <p>Let <var>p</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise②">a new promise</a>.</p>
     <li data-md>
      <p>Run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②">in parallel</a>:</p>
      <ol>
       <li data-md>
        <p>Let <var>list</var> be the results of running <a data-link-type="dfn" href="#query-cookies" id="ref-for-query-cookies②">query cookies</a> with <var>url</var> and <var>name</var>.</p>
       <li data-md>
        <p>If <var>list</var> is failure, then <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise②">reject</a> <var>p</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror④">TypeError</a></code>.</p>
       <li data-md>
        <p>Otherwise, <a data-link-type="dfn">resolve</a> <var>p</var> with <var>list</var>.</p>
      </ol>
     <li data-md>
      <p>Return <var>p</var>.</p>
    </ol>
   </div>
   <div class="algorithm">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="CookieStore" data-dfn-type="method" data-export data-lt="getAll(options)|getAll()" id="dom-cookiestore-getall-options"><code>getAll(<var>options</var>)</code></dfn> method, when invoked, must run these steps: 
    <ol>
     <li data-md>
      <p>Let <var>origin</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object⑥">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin" id="ref-for-concept-origin③">origin</a>.</p>
     <li data-md>
      <p>If <var>origin</var> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque" id="ref-for-concept-origin-opaque③">opaque origin</a>, then return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with⑤">a promise rejected with</a> a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror③">SecurityError</a></code>" <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException③">DOMException</a></code>.</p>
     <li data-md>
      <p>Let <var>url</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object⑦">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url" id="ref-for-concept-environment-creation-url③">creation URL</a>.</p>
     <li data-md>
      <p>If <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoregetoptions-url" id="ref-for-dom-cookiestoregetoptions-url③">url</a></code> dictionary member is present, then run these steps:</p>
      <ol>
       <li data-md>
        <p>Let <var>parsed</var> be the result of <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-basic-url-parser" id="ref-for-concept-basic-url-parser①">parsing</a> <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoregetoptions-url" id="ref-for-dom-cookiestoregetoptions-url④">url</a></code> dictionary member with the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①">context object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object①">relevant settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url" id="ref-for-api-base-url①">API base URL</a>.</p>
       <li data-md>
        <p>If the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-global-object" id="ref-for-current-global-object①">current global object</a> is a <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window①">Window</a></code> object and <var>parsed</var> does not <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-equals" id="ref-for-concept-url-equals①">equal</a> <var>url</var>,
then return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with⑥">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror⑤">TypeError</a></code>.</p>
       <li data-md>
        <p>If <var>parsed</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-origin" id="ref-for-concept-url-origin②">origin</a> and <var>url</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-origin" id="ref-for-concept-url-origin③">origin</a> are not the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin" id="ref-for-same-origin①">same origin</a>,
then return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with⑦">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror⑥">TypeError</a></code>.</p>
       <li data-md>
        <p>Set <var>url</var> to <var>parsed</var>.</p>
      </ol>
     <li data-md>
      <p>Let <var>p</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise③">a new promise</a>.</p>
     <li data-md>
      <p>Run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel③">in parallel</a>:</p>
      <ol>
       <li data-md>
        <p>Let <var>list</var> be the results of running <a data-link-type="dfn" href="#query-cookies" id="ref-for-query-cookies③">query cookies</a> with <var>url</var>, <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoregetoptions-name" id="ref-for-dom-cookiestoregetoptions-name①">name</a></code> dictionary member (if present), and <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoregetoptions-matchtype" id="ref-for-dom-cookiestoregetoptions-matchtype①">matchType</a></code> dictionary member.</p>
       <li data-md>
        <p>If <var>list</var> is failure, then <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise③">reject</a> <var>p</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror⑦">TypeError</a></code>.</p>
       <li data-md>
        <p>Otherwise, <a data-link-type="dfn">resolve</a> <var>p</var> with <var>list</var>.</p>
      </ol>
     <li data-md>
      <p>Return <var>p</var>.</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="3.3" id="CookieStore-set"><span class="secno">3.3. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-set" id="ref-for-dom-cookiestore-set③">set()</a></code> method</span><a class="self-link" href="#CookieStore-set"></a></h3>
   <div class="note" role="note">
    <dl class="domintro">
     <dt>await cookieStore . <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-set" id="ref-for-dom-cookiestore-set④">set</a></code>(<var>name</var>, <var>value</var>) 
     <dt>await cookieStore . <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-set-options" id="ref-for-dom-cookiestore-set-options①">set</a></code>(<var>options</var>) 
     <dd>
       Writes (creates or modifies) a cookie. 
      <p>The options default to:</p>
      <ul>
       <li data-md>
        <p>Path: <code>/</code></p>
       <li data-md>
        <p>Domain: same as the domain of the current document or service worker’s location</p>
       <li data-md>
        <p>No expiry date</p>
       <li data-md>
        <p>Secure flag: set (cookie only transmitted over secure protocol)</p>
       <li data-md>
        <p>SameSite: strict</p>
      </ul>
    </dl>
   </div>
   <div class="algorithm">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="CookieStore" data-dfn-type="method" data-export data-lt="set(name, value, options)|set(name, value)" id="dom-cookiestore-set"><code>set(<var>name</var>, <var>value</var>, <var>options</var>)</code></dfn> method, when invoked, must run these steps: 
    <ol>
     <li data-md>
      <p>Let <var>origin</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object⑧">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin" id="ref-for-concept-origin④">origin</a>.</p>
     <li data-md>
      <p>If <var>origin</var> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque" id="ref-for-concept-origin-opaque④">opaque origin</a>, then return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with⑧">a promise rejected with</a> a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror④">SecurityError</a></code>" <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException④">DOMException</a></code>.</p>
     <li data-md>
      <p>Let <var>url</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object⑨">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url" id="ref-for-concept-environment-creation-url④">creation URL</a>.</p>
     <li data-md>
      <p>Let <var>p</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise④">a new promise</a>.</p>
     <li data-md>
      <p>Run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel④">in parallel</a>:</p>
      <ol>
       <li data-md>
        <p>Let <var>r</var> be the result of running <a data-link-type="dfn" href="#set-a-cookie" id="ref-for-set-a-cookie">set a cookie</a> with <var>url</var>, <var>name</var>, <var>value</var>, <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoresetoptions-expires" id="ref-for-dom-cookiestoresetoptions-expires">expires</a></code> dictionary member, <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoresetoptions-domain" id="ref-for-dom-cookiestoresetoptions-domain">domain</a></code> dictionary member, <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoresetoptions-path" id="ref-for-dom-cookiestoresetoptions-path">path</a></code> dictionary member, <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoresetoptions-secure" id="ref-for-dom-cookiestoresetoptions-secure">secure</a></code> dictionary member, and <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoresetoptions-samesite" id="ref-for-dom-cookiestoresetoptions-samesite">sameSite</a></code> dictionary member.</p>
       <li data-md>
        <p>If <var>r</var> is failure, then <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise④">reject</a> <var>p</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror⑧">TypeError</a></code> and abort these steps.</p>
       <li data-md>
        <p><a data-link-type="dfn">Resolve</a> <var>p</var> with undefined.</p>
      </ol>
     <li data-md>
      <p>Return <var>p</var>.</p>
    </ol>
   </div>
   <div class="algorithm">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="CookieStore" data-dfn-type="method" data-export id="dom-cookiestore-set-options"><code>set(<var>options</var>)</code></dfn> method, when invoked, must run these steps: 
    <ol>
     <li data-md>
      <p>Let <var>origin</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object①⓪">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin" id="ref-for-concept-origin⑤">origin</a>.</p>
     <li data-md>
      <p>If <var>origin</var> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque" id="ref-for-concept-origin-opaque⑤">opaque origin</a>, then return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with⑨">a promise rejected with</a> a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror⑤">SecurityError</a></code>" <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException⑤">DOMException</a></code>.</p>
     <li data-md>
      <p>Let <var>url</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object①①">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url" id="ref-for-concept-environment-creation-url⑤">creation URL</a>.</p>
     <li data-md>
      <p>Let <var>p</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise⑤">a new promise</a>.</p>
     <li data-md>
      <p>Run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑤">in parallel</a>:</p>
      <ol>
       <li data-md>
        <p>Let <var>r</var> be the result of running <a data-link-type="dfn" href="#set-a-cookie" id="ref-for-set-a-cookie①">set a cookie</a> with <var>url</var>, <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoresetextraoptions-name" id="ref-for-dom-cookiestoresetextraoptions-name">name</a></code> dictionary member, <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoresetextraoptions-value" id="ref-for-dom-cookiestoresetextraoptions-value">value</a></code> dictionary member, <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoresetoptions-expires" id="ref-for-dom-cookiestoresetoptions-expires①">expires</a></code> dictionary member, <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoresetoptions-domain" id="ref-for-dom-cookiestoresetoptions-domain①">domain</a></code> dictionary member, <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoresetoptions-path" id="ref-for-dom-cookiestoresetoptions-path①">path</a></code> dictionary member, <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoresetoptions-secure" id="ref-for-dom-cookiestoresetoptions-secure①">secure</a></code> dictionary member, and <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoresetoptions-samesite" id="ref-for-dom-cookiestoresetoptions-samesite①">sameSite</a></code> dictionary member.</p>
       <li data-md>
        <p>If <var>r</var> is failure, then <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise⑤">reject</a> <var>p</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror⑨">TypeError</a></code> and abort these steps.</p>
       <li data-md>
        <p><a data-link-type="dfn">Resolve</a> <var>p</var> with undefined.</p>
      </ol>
     <li data-md>
      <p>Return <var>p</var>.</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="3.4" id="CookieStore-delete"><span class="secno">3.4. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-delete" id="ref-for-dom-cookiestore-delete②">delete()</a></code> method</span><a class="self-link" href="#CookieStore-delete"></a></h3>
   <div class="note" role="note">
    <dl class="domintro">
     <dt>await cookieStore . <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-delete" id="ref-for-dom-cookiestore-delete③">delete</a></code>(<var>name</var>) 
     <dt>await cookieStore . <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-delete-options" id="ref-for-dom-cookiestore-delete-options①">delete</a></code>(<var>options</var>) 
     <dd> Deletes (expires) a cookie with the given name or name and optional domain and path. 
    </dl>
   </div>
   <div class="algorithm">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="CookieStore" data-dfn-type="method" data-export id="dom-cookiestore-delete"><code>delete(<var>name</var>)</code></dfn> method, when invoked, must run these steps: 
    <ol>
     <li data-md>
      <p>Let <var>origin</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object①②">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin" id="ref-for-concept-origin⑥">origin</a>.</p>
     <li data-md>
      <p>If <var>origin</var> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque" id="ref-for-concept-origin-opaque⑥">opaque origin</a>, then return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①⓪">a promise rejected with</a> a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror⑥">SecurityError</a></code>" <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException⑥">DOMException</a></code>.</p>
     <li data-md>
      <p>Let <var>url</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object①③">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url" id="ref-for-concept-environment-creation-url⑥">creation URL</a>.</p>
     <li data-md>
      <p>Let <var>p</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise⑥">a new promise</a>.</p>
     <li data-md>
      <p>Run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑥">in parallel</a>:</p>
      <ol>
       <li data-md>
        <p>Let <var>r</var> be the result of running <a data-link-type="dfn" href="#delete-a-cookie" id="ref-for-delete-a-cookie">delete a cookie</a> with <var>url</var>, <var>name</var>,
null,
"<code>/</code>",
true, and
"<code class="idl"><a data-link-type="idl" href="#dom-cookiesamesite-strict" id="ref-for-dom-cookiesamesite-strict">strict</a></code>".</p>
       <li data-md>
        <p>If <var>r</var> is failure, then <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise⑥">reject</a> <var>p</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror①⓪">TypeError</a></code> and abort these steps.</p>
       <li data-md>
        <p><a data-link-type="dfn">Resolve</a> <var>p</var> with undefined.</p>
      </ol>
     <li data-md>
      <p>Return <var>p</var>.</p>
    </ol>
   </div>
   <div class="algorithm">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="CookieStore" data-dfn-type="method" data-export id="dom-cookiestore-delete-options"><code>delete(<var>options</var>)</code></dfn> method, when invoked, must run these steps: 
    <ol>
     <li data-md>
      <p>Let <var>origin</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object①④">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin" id="ref-for-concept-origin⑦">origin</a>.</p>
     <li data-md>
      <p>If <var>origin</var> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque" id="ref-for-concept-origin-opaque⑦">opaque origin</a>, then return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①①">a promise rejected with</a> a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror⑦">SecurityError</a></code>" <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException⑦">DOMException</a></code>.</p>
     <li data-md>
      <p>Let <var>url</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object①⑤">current settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url" id="ref-for-concept-environment-creation-url⑦">creation URL</a>.</p>
     <li data-md>
      <p>Let <var>p</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise⑦">a new promise</a>.</p>
     <li data-md>
      <p>Run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑦">in parallel</a>:</p>
      <ol>
       <li data-md>
        <p>Let <var>r</var> be the result of running <a data-link-type="dfn" href="#delete-a-cookie" id="ref-for-delete-a-cookie①">delete a cookie</a> with <var>url</var>, <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoredeleteoptions-name" id="ref-for-dom-cookiestoredeleteoptions-name">name</a></code> dictionary member, <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoredeleteoptions-domain" id="ref-for-dom-cookiestoredeleteoptions-domain">domain</a></code> dictionary member, and <var>options</var>’ <code class="idl"><a data-link-type="idl" href="#dom-cookiestoredeleteoptions-path" id="ref-for-dom-cookiestoredeleteoptions-path">path</a></code> dictionary member.</p>
       <li data-md>
        <p>If <var>r</var> is failure, then <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise⑦">reject</a> <var>p</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror①①">TypeError</a></code> and abort these steps.</p>
       <li data-md>
        <p><a data-link-type="dfn">Resolve</a> <var>p</var> with undefined.</p>
      </ol>
     <li data-md>
      <p>Return <var>p</var>.</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="3.5" id="CookieStore-subscribeToChanges"><span class="secno">3.5. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-subscribetochanges" id="ref-for-dom-cookiestore-subscribetochanges②">subscribeToChanges()</a></code> method</span><a class="self-link" href="#CookieStore-subscribeToChanges"></a></h3>
   <div class="note" role="note">
    <dl class="domintro">
     <dt>await cookieStore . <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-subscribetochanges" id="ref-for-dom-cookiestore-subscribetochanges③">subscribeToChanges</a></code>(<var>subscriptions</var>) 
     <dd>
       This method can only be called during a <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker" id="ref-for-dfn-service-worker⑨">Service Worker</a> install phase. 
      <p>Once subscribed, notifications are delivered as "<code>cookiechange</code>" events
      fired against the <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker" id="ref-for-dfn-service-worker①⓪">Service Worker</a>'s global scope:</p>
    </dl>
   </div>
   <div class="algorithm">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="CookieStore" data-dfn-type="method" data-export id="dom-cookiestore-subscribetochanges"><code>subscribeToChanges(<var>subscriptions</var>)</code></dfn> method, when invoked, must run these steps: 
    <ol>
     <li data-md>
      <p>Let <var>serviceWorker</var> be the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②">context object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global">global object</a>'s <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker" id="ref-for-dfn-service-worker①①">service worker</a>.</p>
     <li data-md>
      <p>If <var>serviceWorker</var>’s <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-state" id="ref-for-dfn-state②">state</a> is not <em>installing</em>,
then return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①②">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror①②">TypeError</a></code>.</p>
     <li data-md>
      <p>Let <var>registration</var> be <var>serviceWorker</var>’s associated <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration">containing service worker registration</a>.</p>
     <li data-md>
      <p>Let <var>p</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise⑧">a new promise</a>.</p>
     <li data-md>
      <p>Run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑧">in parallel</a>:</p>
      <ol>
       <li data-md>
        <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate">For each</a> <var>entry</var> in <var>subscriptions</var>, run these steps:</p>
        <ol>
         <li data-md>
          <p>Let <var>name</var> be <var>entry</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookiestoregetoptions-name" id="ref-for-dom-cookiestoregetoptions-name②">name</a></code> member.</p>
         <li data-md>
          <p>Let <var>url</var> be the result of <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-basic-url-parser" id="ref-for-concept-basic-url-parser②">parsing</a> <var>entry</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookiestoregetoptions-url" id="ref-for-dom-cookiestoregetoptions-url⑤">url</a></code> dictionary member with the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object③">context object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object②">relevant settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url" id="ref-for-api-base-url②">API base URL</a>.</p>
         <li data-md>
          <p>If <var>url</var> does not start with <var>registration</var>’s <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-scope-url" id="ref-for-dfn-scope-url①">scope url</a>,
then <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise⑧">reject</a> <var>p</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror①③">TypeError</a></code> and abort these steps.</p>
         <li data-md>
          <p>Let <var>matchType</var> be <var>entry</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookiestoregetoptions-matchtype" id="ref-for-dom-cookiestoregetoptions-matchtype②">matchType</a></code> member.</p>
         <li data-md>
          <p>Let <var>subscription</var> be the <a data-link-type="dfn" href="#cookie-change-subscription" id="ref-for-cookie-change-subscription①">cookie change subscription</a> (<var>name</var>, <var>url</var>, <var>matchType</var>).</p>
         <li data-md>
          <p>Append <var>subscription</var> to <var>registration</var>’s associated <a data-link-type="dfn" href="#cookie-change-subscription-list" id="ref-for-cookie-change-subscription-list">cookie change subscription list</a>.</p>
        </ol>
       <li data-md>
        <p><a data-link-type="dfn">Resolve</a> <var>p</var> with undefined.</p>
      </ol>
     <li data-md>
      <p>Return <var>p</var>.</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="3.6" id="CookieStore-getChangeSubscriptions"><span class="secno">3.6. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-getchangesubscriptions" id="ref-for-dom-cookiestore-getchangesubscriptions②">getChangeSubscriptions()</a></code> method</span><a class="self-link" href="#CookieStore-getChangeSubscriptions"></a></h3>
   <div class="note" role="note">
    <dl class="domintro">
     <dt><var>subscriptions</var> = await cookieStore . <code class="idl"><a data-link-type="idl" href="#dom-cookiestore-getchangesubscriptions" id="ref-for-dom-cookiestore-getchangesubscriptions③">getChangeSubscriptions()</a></code> 
     <dd> This method returns a promise which resolves to a list of the cookie change subscriptions
      made for this Service Worker registration. 
    </dl>
   </div>
   <div class="algorithm">
     The <dfn class="dfn-paneled idl-code" data-dfn-for="CookieStore" data-dfn-type="method" data-export id="dom-cookiestore-getchangesubscriptions"><code>getChangeSubscriptions()</code></dfn> method, when invoked, must run these steps: 
    <ol>
     <li data-md>
      <p>Let <var>serviceWorker</var> be the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object④">context object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global①">global object</a>'s <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker" id="ref-for-dfn-service-worker①②">service worker</a>.</p>
     <li data-md>
      <p>Let <var>registration</var> be <var>serviceWorker</var>’s associated <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration①">containing service worker registration</a>.</p>
     <li data-md>
      <p>Let <var>p</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise⑨">a new promise</a>.</p>
     <li data-md>
      <p>Run the following steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑨">in parallel</a>:</p>
      <ol>
       <li data-md>
        <p>Let <var>subscriptions</var> be <var>registration</var>’s associated <a data-link-type="dfn" href="#cookie-change-subscription-list" id="ref-for-cookie-change-subscription-list①">cookie change subscription list</a>.</p>
       <li data-md>
        <p>Let <var>result</var> be a new <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list①">list</a>.</p>
       <li data-md>
        <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate①">For each</a> <var>subscription</var> in <var>subscriptions</var>, run these steps:</p>
        <ol>
         <li data-md>
          <p>Let <var>options</var> be a new <code class="idl"><a data-link-type="idl" href="#dictdef-cookiestoregetoptions" id="ref-for-dictdef-cookiestoregetoptions④">CookieStoreGetOptions</a></code> dictionary.</p>
         <li data-md>
          <p>Set <var>options</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookiestoregetoptions-name" id="ref-for-dom-cookiestoregetoptions-name③">name</a></code> member to <var>subscription</var>’s <a data-link-type="dfn" href="#cookie-change-subscription-name" id="ref-for-cookie-change-subscription-name">name</a>.</p>
         <li data-md>
          <p>Set <var>options</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookiestoregetoptions-url" id="ref-for-dom-cookiestoregetoptions-url⑥">url</a></code> member to <var>subscription</var>’s <a data-link-type="dfn" href="#cookie-change-subscription-url" id="ref-for-cookie-change-subscription-url">url</a>.</p>
         <li data-md>
          <p>Set <var>options</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookiestoregetoptions-matchtype" id="ref-for-dom-cookiestoregetoptions-matchtype③">matchType</a></code> member to <var>subscription</var>’s <a data-link-type="dfn" href="#cookie-change-subscription-matchtype" id="ref-for-cookie-change-subscription-matchtype">matchType</a>.</p>
        </ol>
       <li data-md>
        <p><a data-link-type="dfn">Resolve</a> <var>p</var> with <var>result</var>.</p>
      </ol>
     <li data-md>
      <p>Return <var>p</var>.</p>
    </ol>
   </div>
   <h2 class="heading settled" data-level="4" id="event-interfaces"><span class="secno">4. </span><span class="content">Event Interfaces</span><a class="self-link" href="#event-interfaces"></a></h2>
   <h3 class="heading settled" data-level="4.1" id="CookieChangeEvent"><span class="secno">4.1. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#cookiechangeevent" id="ref-for-cookiechangeevent">CookieChangeEvent</a></code> interface</span><a class="self-link" href="#CookieChangeEvent"></a></h3>
   <p>A <code class="idl"><a data-link-type="idl" href="#cookiechangeevent" id="ref-for-cookiechangeevent①">CookieChangeEvent</a></code> is <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-dispatch" id="ref-for-concept-event-dispatch">dispatched</a> against <code class="idl"><a data-link-type="idl" href="#cookiestore" id="ref-for-cookiestore②">CookieStore</a></code> objects
in <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window②">Window</a></code> contexts when any <a data-link-type="dfn" href="#script-visible" id="ref-for-script-visible④">script-visible</a> cookie changes have occurred.</p>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed④"><c- g>Exposed</c-></a>=<c- n>Window</c->,
 <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="cookiechangeevent"><code><c- g>CookieChangeEvent</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event" id="ref-for-event"><c- n>Event</c-></a> {
  <dfn class="idl-code" data-dfn-for="CookieChangeEvent" data-dfn-type="constructor" data-export data-lt="CookieChangeEvent(type, eventInitDict)|constructor(type, eventInitDict)|CookieChangeEvent(type)|constructor(type)" id="dom-cookiechangeevent-cookiechangeevent"><code><c- g>constructor</c-></code><a class="self-link" href="#dom-cookiechangeevent-cookiechangeevent"></a></dfn>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="CookieChangeEvent/CookieChangeEvent(type, eventInitDict), CookieChangeEvent/constructor(type, eventInitDict), CookieChangeEvent/CookieChangeEvent(type), CookieChangeEvent/constructor(type)" data-dfn-type="argument" data-export id="dom-cookiechangeevent-cookiechangeevent-type-eventinitdict-type"><code><c- g>type</c-></code><a class="self-link" href="#dom-cookiechangeevent-cookiechangeevent-type-eventinitdict-type"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cookiechangeeventinit" id="ref-for-dictdef-cookiechangeeventinit"><c- n>CookieChangeEventInit</c-></a> <dfn class="idl-code" data-dfn-for="CookieChangeEvent/CookieChangeEvent(type, eventInitDict), CookieChangeEvent/constructor(type, eventInitDict), CookieChangeEvent/CookieChangeEvent(type), CookieChangeEvent/constructor(type)" data-dfn-type="argument" data-export id="dom-cookiechangeevent-cookiechangeevent-type-eventinitdict-eventinitdict"><code><c- g>eventInitDict</c-></code><a class="self-link" href="#dom-cookiechangeevent-cookiechangeevent-type-eventinitdict-eventinitdict"></a></dfn> = {});
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist②"><c- n>CookieList</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="CookieChangeEvent" data-dfn-type="attribute" data-export data-readonly data-type="CookieList" id="dom-cookiechangeevent-changed"><code><c- g>changed</c-></code></dfn>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist③"><c- n>CookieList</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="CookieChangeEvent" data-dfn-type="attribute" data-export data-readonly data-type="CookieList" id="dom-cookiechangeevent-deleted"><code><c- g>deleted</c-></code></dfn>;
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-cookiechangeeventinit"><code><c- g>CookieChangeEventInit</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit" id="ref-for-dictdef-eventinit"><c- n>EventInit</c-></a> {
  <a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist④"><c- n>CookieList</c-></a> <dfn class="idl-code" data-dfn-for="CookieChangeEventInit" data-dfn-type="dict-member" data-export data-type="CookieList " id="dom-cookiechangeeventinit-changed"><code><c- g>changed</c-></code><a class="self-link" href="#dom-cookiechangeeventinit-changed"></a></dfn>;
  <a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist⑤"><c- n>CookieList</c-></a> <dfn class="idl-code" data-dfn-for="CookieChangeEventInit" data-dfn-type="dict-member" data-export data-type="CookieList " id="dom-cookiechangeeventinit-deleted"><code><c- g>deleted</c-></code><a class="self-link" href="#dom-cookiechangeeventinit-deleted"></a></dfn>;
};
</pre>
   <p>The <code class="idl"><a data-link-type="idl" href="#dom-cookiechangeevent-changed" id="ref-for-dom-cookiechangeevent-changed">changed</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-cookiechangeevent-deleted" id="ref-for-dom-cookiechangeevent-deleted">deleted</a></code> attributes must return the value they were initialized to.</p>
   <h3 class="heading settled" data-level="4.2" id="ExtendableCookieChangeEvent"><span class="secno">4.2. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#extendablecookiechangeevent" id="ref-for-extendablecookiechangeevent">ExtendableCookieChangeEvent</a></code> interface</span><a class="self-link" href="#ExtendableCookieChangeEvent"></a></h3>
   <p>An <code class="idl"><a data-link-type="idl" href="#extendablecookiechangeevent" id="ref-for-extendablecookiechangeevent①">ExtendableCookieChangeEvent</a></code> is <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-dispatch" id="ref-for-concept-event-dispatch①">dispatched</a> against <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope" id="ref-for-serviceworkerglobalscope">ServiceWorkerGlobalScope</a></code> objects when any <a data-link-type="dfn" href="#script-visible" id="ref-for-script-visible⑤">script-visible</a> cookie changes have occurred which match the <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker" id="ref-for-dfn-service-worker①③">Service Worker</a>'s <a data-link-type="dfn" href="#cookie-change-subscription-list" id="ref-for-cookie-change-subscription-list②">cookie change subscription list</a>.</p>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑤"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->
] <c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="extendablecookiechangeevent"><code><c- g>ExtendableCookieChangeEvent</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://w3c.github.io/ServiceWorker/#extendableevent" id="ref-for-extendableevent"><c- n>ExtendableEvent</c-></a> {
  <dfn class="idl-code" data-dfn-for="ExtendableCookieChangeEvent" data-dfn-type="constructor" data-export data-lt="ExtendableCookieChangeEvent(type, eventInitDict)|constructor(type, eventInitDict)|ExtendableCookieChangeEvent(type)|constructor(type)" id="dom-extendablecookiechangeevent-extendablecookiechangeevent"><code><c- g>constructor</c-></code><a class="self-link" href="#dom-extendablecookiechangeevent-extendablecookiechangeevent"></a></dfn>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="ExtendableCookieChangeEvent/ExtendableCookieChangeEvent(type, eventInitDict), ExtendableCookieChangeEvent/constructor(type, eventInitDict), ExtendableCookieChangeEvent/ExtendableCookieChangeEvent(type), ExtendableCookieChangeEvent/constructor(type)" data-dfn-type="argument" data-export id="dom-extendablecookiechangeevent-extendablecookiechangeevent-type-eventinitdict-type"><code><c- g>type</c-></code><a class="self-link" href="#dom-extendablecookiechangeevent-extendablecookiechangeevent-type-eventinitdict-type"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-extendablecookiechangeeventinit" id="ref-for-dictdef-extendablecookiechangeeventinit"><c- n>ExtendableCookieChangeEventInit</c-></a> <dfn class="idl-code" data-dfn-for="ExtendableCookieChangeEvent/ExtendableCookieChangeEvent(type, eventInitDict), ExtendableCookieChangeEvent/constructor(type, eventInitDict), ExtendableCookieChangeEvent/ExtendableCookieChangeEvent(type), ExtendableCookieChangeEvent/constructor(type)" data-dfn-type="argument" data-export id="dom-extendablecookiechangeevent-extendablecookiechangeevent-type-eventinitdict-eventinitdict"><code><c- g>eventInitDict</c-></code><a class="self-link" href="#dom-extendablecookiechangeevent-extendablecookiechangeevent-type-eventinitdict-eventinitdict"></a></dfn> = {});
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist⑥"><c- n>CookieList</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="ExtendableCookieChangeEvent" data-dfn-type="attribute" data-export data-readonly data-type="CookieList" id="dom-extendablecookiechangeevent-changed"><code><c- g>changed</c-></code></dfn>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist⑦"><c- n>CookieList</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="ExtendableCookieChangeEvent" data-dfn-type="attribute" data-export data-readonly data-type="CookieList" id="dom-extendablecookiechangeevent-deleted"><code><c- g>deleted</c-></code></dfn>;
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-extendablecookiechangeeventinit"><code><c- g>ExtendableCookieChangeEventInit</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://w3c.github.io/ServiceWorker/#dictdef-extendableeventinit" id="ref-for-dictdef-extendableeventinit"><c- n>ExtendableEventInit</c-></a> {
  <a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist⑧"><c- n>CookieList</c-></a> <dfn class="idl-code" data-dfn-for="ExtendableCookieChangeEventInit" data-dfn-type="dict-member" data-export data-type="CookieList " id="dom-extendablecookiechangeeventinit-changed"><code><c- g>changed</c-></code><a class="self-link" href="#dom-extendablecookiechangeeventinit-changed"></a></dfn>;
  <a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist⑨"><c- n>CookieList</c-></a> <dfn class="idl-code" data-dfn-for="ExtendableCookieChangeEventInit" data-dfn-type="dict-member" data-export data-type="CookieList " id="dom-extendablecookiechangeeventinit-deleted"><code><c- g>deleted</c-></code><a class="self-link" href="#dom-extendablecookiechangeeventinit-deleted"></a></dfn>;
};
</pre>
   <p>The <code class="idl"><a data-link-type="idl" href="#dom-extendablecookiechangeevent-changed" id="ref-for-dom-extendablecookiechangeevent-changed">changed</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-extendablecookiechangeevent-deleted" id="ref-for-dom-extendablecookiechangeevent-deleted">deleted</a></code> attributes must return the value they were initialized to.</p>
   <h2 class="heading settled" data-level="5" id="globals"><span class="secno">5. </span><span class="content">Global Interfaces</span><a class="self-link" href="#globals"></a></h2>
   <p>A <code class="idl"><a data-link-type="idl" href="#cookiestore" id="ref-for-cookiestore③">CookieStore</a></code> is accessed by script using an attribute in the global
scope in a <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window③">Window</a></code> or <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope" id="ref-for-serviceworkerglobalscope①">ServiceWorkerGlobalScope</a></code> context.</p>
   <h3 class="heading settled" data-level="5.1" id="Window"><span class="secno">5.1. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window④">Window</a></code> interface</span><a class="self-link" href="#Window"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext②"><c- g>SecureContext</c-></a>]
<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window⑤"><c- g>Window</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Replaceable" id="ref-for-Replaceable"><c- g>Replaceable</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#cookiestore" id="ref-for-cookiestore④"><c- n>CookieStore</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="attribute" data-export data-readonly data-type="CookieStore" id="dom-window-cookiestore"><code><c- g>cookieStore</c-></code></dfn>;
};
</pre>
   <p>The <code class="idl"><a data-link-type="idl" href="#dom-window-cookiestore" id="ref-for-dom-window-cookiestore②">cookieStore</a></code> attribute’s getter must return <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object⑤">context object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object③">relevant settings object</a>'s <code class="idl"><a data-link-type="idl" href="#cookiestore" id="ref-for-cookiestore⑤">CookieStore</a></code> object.</p>
   <h3 class="heading settled" data-level="5.2" id="ServiceWorkerGlobalScope"><span class="secno">5.2. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope" id="ref-for-serviceworkerglobalscope②">ServiceWorkerGlobalScope</a></code> interface</span><a class="self-link" href="#ServiceWorkerGlobalScope"></a></h3>
<pre class="idl highlight def"><c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope" id="ref-for-serviceworkerglobalscope③"><c- g>ServiceWorkerGlobalScope</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Replaceable" id="ref-for-Replaceable①"><c- g>Replaceable</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#cookiestore" id="ref-for-cookiestore⑥"><c- n>CookieStore</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="attribute" data-export data-readonly data-type="CookieStore" id="dom-serviceworkerglobalscope-cookiestore"><code><c- g>cookieStore</c-></code></dfn>;

  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler①"><c- n>EventHandler</c-></a> <dfn class="idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="attribute" data-export data-type="EventHandler" id="dom-serviceworkerglobalscope-oncookiechange"><code><c- g>oncookiechange</c-></code><a class="self-link" href="#dom-serviceworkerglobalscope-oncookiechange"></a></dfn>;
};
</pre>
   <p>The <code class="idl"><a data-link-type="idl" href="#dom-serviceworkerglobalscope-cookiestore" id="ref-for-dom-serviceworkerglobalscope-cookiestore">cookieStore</a></code> attribute’s getter must return <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object⑥">context object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object④">relevant settings object</a>'s <code class="idl"><a data-link-type="idl" href="#cookiestore" id="ref-for-cookiestore⑦">CookieStore</a></code> object.</p>
   <h2 class="heading settled" data-level="6" id="algorithms"><span class="secno">6. </span><span class="content">Algorithms</span><a class="self-link" href="#algorithms"></a></h2>
   <p><a data-link-type="dfn" href="#cookie" id="ref-for-cookie④">Cookie</a> attribute-values are stored as <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence">byte sequences</a>, not strings.</p>
   <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="encode">encode</dfn> a <var>string</var>, run <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-encode" id="ref-for-utf-8-encode">UTF-8 encode</a> on <var>string</var>.</p>
   <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="decode">decode</dfn> a <var>value</var>, run <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-decode-without-bom" id="ref-for-utf-8-decode-without-bom">UTF-8 decode without BOM</a> on <var>value</var>.</p>
   <h3 class="heading settled" data-level="6.1" id="query-cookies-algorithm"><span class="secno">6.1. </span><span class="content">Query Cookies</span><a class="self-link" href="#query-cookies-algorithm"></a></h3>
   <div class="algorithm">
    <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="query-cookies">query cookies</dfn> with <var>url</var>,
optional <var>name</var>, and
optional <var>matchType</var>,
run the following steps:</p>
    <ol>
     <li data-md>
      <p>Perform the steps defined in <a href="https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-5.5">Cookies: HTTP State Management Mechanism §The Cookie Header</a> to "compute the cookie-string from a cookie store"
with <var>url</var> as <var>request-uri</var>.
The <var>cookie-string</var> itself is ignored, but the intermediate <var>cookie-list</var> is used in subsequent steps.</p>
      <p>For the purposes of the steps, the <var>cookie-string</var> is being generated for a "non-HTTP" API.</p>
     <li data-md>
      <p>Let <var>list</var> be a new <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list②">list</a>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate②">For each</a> <var>cookie</var> in <var>cookie-list</var>, run these steps:</p>
      <ol>
       <li data-md>
        <p class="assertion">Assert: <var>cookie</var>’s <a data-link-type="dfn" href="#cookie-http-only-flag" id="ref-for-cookie-http-only-flag">http-only-flag</a> is false.</p>
       <li data-md>
        <p>If <var>name</var> is given, then run these steps:</p>
        <ol>
         <li data-md>
          <p>Let <var>cookieName</var> be <var>cookie</var>’s <a data-link-type="dfn" href="#cookie-name" id="ref-for-cookie-name①">name</a> (<a data-link-type="dfn" href="#decode" id="ref-for-decode">decoded</a>).</p>
         <li data-md>
          <p>If <var>cookieName</var> does not <a data-link-type="dfn" href="#matches" id="ref-for-matches">match</a> <var>name</var> using <var>matchType</var>,
 then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#iteration-continue" id="ref-for-iteration-continue">continue</a>.</p>
        </ol>
       <li data-md>
        <p>Let <var>item</var> be the result of running <a data-link-type="dfn" href="#create-a-cookielistitem" id="ref-for-create-a-cookielistitem">create a CookieListItem</a> from <var>cookie</var>.</p>
       <li data-md>
        <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append">Append</a> <var>item</var> to <var>list</var>.</p>
      </ol>
     <li data-md>
      <p>Return <var>list</var>.</p>
    </ol>
   </div>
   <div class="algorithm">
    <p>A <var>cookieName</var> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="matches">matches</dfn> <var>matchName</var> using <var>matchType</var> if the following steps return true:</p>
    <ol>
     <li data-md>
      <p>Switch on <var>matchType</var>:</p>
      <dl class="switch">
       <dt data-md>unspecified
       <dd data-md>
        <p>Return true.</p>
       <dt data-md>"<code class="idl"><a data-link-type="idl" href="#dom-cookiematchtype-equals" id="ref-for-dom-cookiematchtype-equals">equals</a></code>"
       <dd data-md>
        <p>If <var>cookieName</var> does not equal <var>matchName</var>,
then return false.</p>
       <dt data-md>"<code class="idl"><a data-link-type="idl" href="#dom-cookiematchtype-starts-with" id="ref-for-dom-cookiematchtype-starts-with">starts-with</a></code>"
       <dd data-md>
        <p>If <var>cookieName</var> does not start with <var>matchName</var>,
then return false.</p>
      </dl>
     <li data-md>
      <p>Return true.</p>
    </ol>
    <p class="note" role="note"><span>Note:</span> If <var>matchName</var> is the empty string and <var>matchType</var> is "<code class="idl"><a data-link-type="idl" href="#dom-cookiematchtype-starts-with" id="ref-for-dom-cookiematchtype-starts-with①">starts-with</a></code>",
       then all <var>cookieName</var>s are matched.</p>
   </div>
   <div class="algorithm">
    <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="create-a-cookielistitem">create a <code class="idl"><a data-link-type="idl" href="#dictdef-cookielistitem" id="ref-for-dictdef-cookielistitem③">CookieListItem</a></code></dfn> from <var>cookie</var>, run the following steps.</p>
    <ol>
     <li data-md>
      <p>Let <var>item</var> be a new <code class="idl"><a data-link-type="idl" href="#dictdef-cookielistitem" id="ref-for-dictdef-cookielistitem④">CookieListItem</a></code>.</p>
     <li data-md>
      <p>Set <var>item</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookielistitem-name" id="ref-for-dom-cookielistitem-name">name</a></code> dictionary member to <var>cookie</var>’s <a data-link-type="dfn" href="#cookie-name" id="ref-for-cookie-name②">name</a> (<a data-link-type="dfn" href="#decode" id="ref-for-decode①">decoded</a>).</p>
     <li data-md>
      <p>Set <var>item</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookielistitem-value" id="ref-for-dom-cookielistitem-value">value</a></code> dictionary member to <var>cookie</var>’s <a data-link-type="dfn" href="#cookie-value" id="ref-for-cookie-value①">value</a> (<a data-link-type="dfn" href="#decode" id="ref-for-decode②">decoded</a>).</p>
     <li data-md>
      <p>Set <var>item</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookielistitem-domain" id="ref-for-dom-cookielistitem-domain">domain</a></code> dictionary member to <var>cookie</var>’s <a data-link-type="dfn" href="#cookie-domain" id="ref-for-cookie-domain">domain</a> (<a data-link-type="dfn" href="#decode" id="ref-for-decode③">decoded</a>).</p>
     <li data-md>
      <p>Set <var>item</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookielistitem-path" id="ref-for-dom-cookielistitem-path">path</a></code> dictionary member to <var>cookie</var>’s <a data-link-type="dfn" href="#cookie-path" id="ref-for-cookie-path">path</a> (<a data-link-type="dfn" href="#decode" id="ref-for-decode④">decoded</a>).</p>
     <li data-md>
      <p>Set <var>item</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookielistitem-expires" id="ref-for-dom-cookielistitem-expires">expires</a></code> dictionary member to <var>cookie</var>’s <a data-link-type="dfn" href="#cookie-expiry-time" id="ref-for-cookie-expiry-time">expiry-time</a> (<a data-link-type="dfn" href="#as-a-timestamp" id="ref-for-as-a-timestamp">as a timestamp</a>).</p>
     <li data-md>
      <p>Set <var>item</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookielistitem-secure" id="ref-for-dom-cookielistitem-secure">secure</a></code> dictionary member to <var>cookie</var>’s <a data-link-type="dfn" href="#cookie-secure-only-flag" id="ref-for-cookie-secure-only-flag">secure-only-flag</a>.</p>
     <li data-md>
      <p>Switch on <var>cookie</var>’s <a data-link-type="dfn" href="#cookie-same-site-flag" id="ref-for-cookie-same-site-flag">same-site-flag</a>:</p>
      <dl class="switch">
       <dt data-md>`<code>None</code>`
       <dd data-md>
        <p>Set <var>item</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookielistitem-samesite" id="ref-for-dom-cookielistitem-samesite">sameSite</a></code> dictionary member to "<code class="idl"><a data-link-type="idl" href="#dom-cookiesamesite-none" id="ref-for-dom-cookiesamesite-none">none</a></code>".</p>
       <dt data-md>`<code>Strict</code>`
       <dd data-md>
        <p>Set <var>item</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookielistitem-samesite" id="ref-for-dom-cookielistitem-samesite①">sameSite</a></code> dictionary member to "<code class="idl"><a data-link-type="idl" href="#dom-cookiesamesite-strict" id="ref-for-dom-cookiesamesite-strict①">strict</a></code>".</p>
       <dt data-md>`<code>Lax</code>`
       <dd data-md>
        <p>Set <var>item</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookielistitem-samesite" id="ref-for-dom-cookielistitem-samesite②">sameSite</a></code> dictionary member to "<code class="idl"><a data-link-type="idl" href="#dom-cookiesamesite-lax" id="ref-for-dom-cookiesamesite-lax">lax</a></code>".</p>
      </dl>
     <li data-md>
      <p>Return <var>item</var>.</p>
    </ol>
    <p class="note" role="note"><span>Note:</span> The <var>cookie</var>’s <a data-link-type="dfn" href="#cookie-creation-time" id="ref-for-cookie-creation-time">creation-time</a>, <a data-link-type="dfn" href="#cookie-last-access-time" id="ref-for-cookie-last-access-time">last-access-time</a>, <a data-link-type="dfn" href="#cookie-persistent-flag" id="ref-for-cookie-persistent-flag">persistent-flag</a>, <a data-link-type="dfn" href="#cookie-host-only-flag" id="ref-for-cookie-host-only-flag">host-only-flag</a>, and <a data-link-type="dfn" href="#cookie-http-only-flag" id="ref-for-cookie-http-only-flag①">http-only-flag</a> attributes are not exposed to script.</p>
   </div>
   <div class="algorithm">
     To represent a date and time <var>dateTime</var> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="as-a-timestamp">as a timestamp</dfn>,
return the number of milliseconds from 00:00:00 UTC, 1 January 1970 to <var>dateTime</var>,
(assuming that there are exactly 86,400,000 milliseconds per day). 
    <p class="note" role="note"><span>Note:</span> This is the same representation used for <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-time-values-and-time-range" id="ref-for-sec-time-values-and-time-range">time values</a> in <a data-link-type="biblio" href="#biblio-ecmascript">[ECMAScript]</a>.</p>
   </div>
   <h3 class="heading settled" data-level="6.2" id="set-cookie-algorithm"><span class="secno">6.2. </span><span class="content">Set a Cookie</span><a class="self-link" href="#set-cookie-algorithm"></a></h3>
   <div class="algorithm">
    <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="set-a-cookie">set a cookie</dfn> with <var>url</var>, <var>name</var>, <var>value</var>,
optional <var>expires</var>, <var>domain</var>, <var>path</var>, <var>secure</var> flag, and <var>sameSite</var>,
run the following steps:</p>
    <ol>
     <li data-md>
      <p>If <var>name</var>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string-length" id="ref-for-string-length">length</a> is 0 and <var>value</var> contains U+003D (<code>=</code>), then return failure.</p>
     <li data-md>
      <p>Let <var>host</var> be <var>url</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-host" id="ref-for-concept-url-host">host</a></p>
     <li data-md>
      <p>If <var>domain</var> is not null, then run these steps:</p>
      <ol>
       <li data-md>
        <p>If <var>domain</var> starts with U+002D (<code>.</code>), then return failure.</p>
       <li data-md>
        <p>If <var>host</var> does not equal <var>domain</var> and <var>host</var> does not end with U+002D (<code>.</code>) followed by <var>domain</var>,
then return failure.</p>
      </ol>
     <li data-md>
      <p>Otherwise, if <var>domain</var> is null, then set <var>domain</var> to <var>host</var>.</p>
     <li data-md>
      <p>If <var>secure</var> is false and <var>name</var> starts with either "<code>__Secure-</code>" or "<code>__Host-</code>",
then return failure.</p>
     <li data-md>
      <p>Let <var>attributes</var> be a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list③">list</a>.</p>
     <li data-md>
      <p>If <var>expires</var> is given, then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append①">append</a> `<code>Expires</code>`/<var>expires</var> (<a data-link-type="dfn" href="#date-serialize" id="ref-for-date-serialize">date serialized</a>) to <var>attributes</var>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append②">Append</a> `<code>Domain</code>`/<var>domain</var> (<a data-link-type="dfn" href="#encode" id="ref-for-encode">encoded</a>) to <var>attributes</var>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append③">Append</a> `<code>Path</code>`/<var>path</var> (<a data-link-type="dfn" href="#encode" id="ref-for-encode①">encoded</a>) to <var>attributes</var>.</p>
     <li data-md>
      <p>If <var>secure</var> is true, then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append④">append</a> `<code>Secure</code>`/`` to <var>attributes</var>.</p>
     <li data-md>
      <p>Switch on <var>sameSite</var>:</p>
      <dl class="switch">
       <dt data-md>"<code class="idl"><a data-link-type="idl" href="#dom-cookiesamesite-none" id="ref-for-dom-cookiesamesite-none①">none</a></code>"
       <dd data-md>
        <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append⑤">Append</a> `<code>SameSite</code>`/`<code>None</code>` to <var>attributes</var>.</p>
       <dt data-md>"<code class="idl"><a data-link-type="idl" href="#dom-cookiesamesite-strict" id="ref-for-dom-cookiesamesite-strict②">strict</a></code>"
       <dd data-md>
        <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append⑥">Append</a> `<code>SameSite</code>`/`<code>Strict</code>` to <var>attributes</var>.</p>
       <dt data-md>"<code class="idl"><a data-link-type="idl" href="#dom-cookiesamesite-lax" id="ref-for-dom-cookiesamesite-lax①">lax</a></code>"
       <dd data-md>
        <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append⑦">Append</a> `<code>SameSite</code>`/`<code>Lax</code>` to <var>attributes</var>.</p>
      </dl>
     <li data-md>
      <p>Perform the steps defined in <a href="https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-5.4">Cookies: HTTP State Management Mechanism §Storage Model</a> for when the user agent "receives a cookie" with <var>url</var> as <var>request-uri</var>, <var>name</var> (<a data-link-type="dfn" href="#encode" id="ref-for-encode②">encoded</a>) as <var>cookie-name</var>, <var>value</var> (<a data-link-type="dfn" href="#encode" id="ref-for-encode③">encoded</a>) as <var>cookie-value</var>, and <var>attributes</var> as <var>cookie-attribute-list</var>.</p>
      <p>For the purposes of the steps, the newly-created cookie was received from a "non-HTTP" API.</p>
     <li data-md>
      <p>Return success.</p>
      <p class="note" role="note"><span>Note:</span> Storing the cookie may still fail due to requirements in <a data-link-type="biblio" href="#biblio-rfc6265bis">[RFC6265bis]</a> but these steps will be considered successful.</p>
    </ol>
   </div>
   <div class="algorithm"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="date-serialize">date serialize</dfn> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#DOMTimeStamp" id="ref-for-DOMTimeStamp②">DOMTimeStamp</a></code> <var>millis</var>,
let <var>dateTime</var> be the date and time <var>millis</var> milliseconds after 00:00:00 UTC, 1 January 1970
(assuming that there are exactly 86,400,000 milliseconds per day),
and return a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence①">byte sequence</a> corresponding to the closest <code>cookie-date</code> representation of <var>dateTime</var> according to <a href="https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-5.1.1">Cookies: HTTP State Management Mechanism §Dates</a>. </div>
   <h3 class="heading settled" data-level="6.3" id="delete-cookie-algorithm"><span class="secno">6.3. </span><span class="content">Delete a Cookie</span><a class="self-link" href="#delete-cookie-algorithm"></a></h3>
   <div class="algorithm">
    <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="delete-a-cookie">delete a cookie</dfn> with <var>url</var>, <var>name</var>, <var>domain</var> and <var>path</var>,
run the following steps:</p>
    <ol>
     <li data-md>
      <p>Let <var>expires</var> be the earliest representable date represented <a data-link-type="dfn" href="#as-a-timestamp" id="ref-for-as-a-timestamp①">as a timestamp</a>.</p>
      <p class="note" role="note"><span>Note:</span> The exact value of <var>expires</var> is not important for the purposes of this algorithm,
as long as it is in the past.</p>
     <li data-md>
      <p>Let <var>value</var> be the empty string.</p>
     <li data-md>
      <p>Let <var>secure</var> be true.</p>
     <li data-md>
      <p>Let <var>sameSite</var> be "<code class="idl"><a data-link-type="idl" href="#dom-cookiesamesite-strict" id="ref-for-dom-cookiesamesite-strict③">strict</a></code>".</p>
      <p class="note" role="note"><span>Note:</span> The values for <var>value</var>, <var>secure</var>, and <var>sameSite</var> will not be persisted
by this algorithm.</p>
     <li data-md>
      <p>Return the results of running <a data-link-type="dfn" href="#set-a-cookie" id="ref-for-set-a-cookie②">set a cookie</a> with <var>url</var>, <var>name</var>, <var>value</var>, <var>expires</var>, <var>domain</var>, <var>path</var>, <var>secure</var>, and <var>sameSite</var>.</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="6.4" id="process-changes"><span class="secno">6.4. </span><span class="content">Process Changes</span><a class="self-link" href="#process-changes"></a></h3>
   <div class="algorithm">
    <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="process-cookie-changes">process cookie changes</dfn>, run the following steps:</p>
    <ol>
     <li data-md>
      <p>For every <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window⑥">Window</a></code> <var>window</var>, run the following steps:</p>
      <ol>
       <li data-md>
        <p>Let <var>url</var> be <var>window</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url" id="ref-for-concept-environment-creation-url⑧">creation URL</a>.</p>
       <li data-md>
        <p>Let <var>changes</var> be the <a data-link-type="dfn" href="#observable-changes" id="ref-for-observable-changes">observable changes</a> for <var>url</var>.</p>
       <li data-md>
        <p>If <var>changes</var> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-is-empty" id="ref-for-list-is-empty②">is empty</a>, then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#iteration-continue" id="ref-for-iteration-continue①">continue</a>.</p>
       <li data-md>
        <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task">Queue a task</a> to <a data-link-type="dfn" href="#fire-a-change-event" id="ref-for-fire-a-change-event">fire a change event</a> named "<code>change</code>" with <var>changes</var> at <var>window</var>’s <code class="idl"><a data-link-type="idl" href="#cookiestore" id="ref-for-cookiestore⑧">CookieStore</a></code> on <var>window</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop">responsible event loop</a>.</p>
      </ol>
     <li data-md>
      <p>For every <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration③">service worker registration</a> <var>registration</var>, run the following steps:</p>
      <ol>
       <li data-md>
        <p>Let <var>changes</var> be a new <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set">set</a>.</p>
       <li data-md>
        <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate③">For each</a> <var>change</var> in the <a data-link-type="dfn" href="#observable-changes" id="ref-for-observable-changes①">observable changes</a> for <var>registration</var>’s <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-scope-url" id="ref-for-dfn-scope-url②">scope url</a>, run these steps:</p>
        <ol>
         <li data-md>
          <p>Let <var>cookie</var> be <var>change</var>’s cookie.</p>
         <li data-md>
          <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate④">For each</a> <var>subscription</var> in <var>registration</var>’s <a data-link-type="dfn" href="#cookie-change-subscription-list" id="ref-for-cookie-change-subscription-list③">cookie change subscription list</a>, run these steps:</p>
          <ol>
           <li data-md>
            <p>If <var>change</var> is not <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-contain" id="ref-for-list-contain">in</a> the <a data-link-type="dfn" href="#observable-changes" id="ref-for-observable-changes②">observable changes</a> for <var>subscription</var>’s <a data-link-type="dfn" href="#cookie-change-subscription-url" id="ref-for-cookie-change-subscription-url①">url</a>,
then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#iteration-continue" id="ref-for-iteration-continue②">continue</a>.</p>
           <li data-md>
            <p>If <var>cookie</var>’s <a data-link-type="dfn" href="#cookie-name" id="ref-for-cookie-name③">name</a> (<a data-link-type="dfn" href="#decode" id="ref-for-decode⑤">decoded</a>) <a data-link-type="dfn" href="#matches" id="ref-for-matches①">matches</a> <var>subscription</var>’s <a data-link-type="dfn" href="#cookie-change-subscription-name" id="ref-for-cookie-change-subscription-name①">name</a> using <var>subscription</var>’s <a data-link-type="dfn" href="#cookie-change-subscription-matchtype" id="ref-for-cookie-change-subscription-matchtype①">matchType</a>,
then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#set-append" id="ref-for-set-append">append</a> <var>change</var> to <var>changes</var> and <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#iteration-break" id="ref-for-iteration-break">break</a>.</p>
          </ol>
        </ol>
       <li data-md>
        <p>If <var>changes</var> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-is-empty" id="ref-for-list-is-empty③">is empty</a>, then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#iteration-continue" id="ref-for-iteration-continue③">continue</a>.</p>
       <li data-md>
        <p>Let <var>changedList</var> and <var>deletedList</var> be the result of running <a data-link-type="dfn" href="#prepare-lists" id="ref-for-prepare-lists">prepare lists</a> using <var>changes</var> for <var>registration</var>.</p>
       <li data-md>
        <p><a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#fire-functional-event" id="ref-for-fire-functional-event">Fire a functional event</a> named "<code>cookiechange</code>"
using <code class="idl"><a data-link-type="idl" href="#extendablecookiechangeevent" id="ref-for-extendablecookiechangeevent②">ExtendableCookieChangeEvent</a></code> on <var>registration</var> with these properties:</p>
        <dl>
         <dt data-md><code class="idl"><a data-link-type="idl" href="#dom-extendablecookiechangeevent-changed" id="ref-for-dom-extendablecookiechangeevent-changed①">changed</a></code>
         <dd data-md>
          <p><var>changedList</var></p>
         <dt data-md><code class="idl"><a data-link-type="idl" href="#dom-extendablecookiechangeevent-deleted" id="ref-for-dom-extendablecookiechangeevent-deleted①">deleted</a></code>
         <dd data-md>
          <p><var>deletedList</var></p>
        </dl>
      </ol>
    </ol>
   </div>
   <div class="algorithm">
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="observable-changes">observable changes</dfn> for <var>url</var> are the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-set" id="ref-for-ordered-set①">set</a> of <a data-link-type="dfn" href="#cookie-change" id="ref-for-cookie-change">cookie changes</a> to <a data-link-type="dfn" href="#cookie" id="ref-for-cookie⑤">cookies</a> in a <a data-link-type="dfn" href="#cookie-store" id="ref-for-cookie-store④">cookie store</a> which meet the requirements in step 1 of <a href="https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-5.5">Cookies: HTTP State Management Mechanism §The Cookie Header</a>'s steps to "compute the cookie-string from a cookie store"
with <var>url</var> as <var>request-uri</var>, for a "non-HTTP" API.</p>
    <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="cookie-change">cookie change</dfn> is a <a data-link-type="dfn" href="#cookie" id="ref-for-cookie⑥">cookie</a> and a type (either <em>changed</em> or <em>deleted</em>):</p>
    <ul>
     <li data-md>
      <p>A <a data-link-type="dfn" href="#cookie" id="ref-for-cookie⑦">cookie</a> which is removed due to an insertion of another <a data-link-type="dfn" href="#cookie" id="ref-for-cookie⑧">cookie</a> with the same <a data-link-type="dfn" href="#cookie-name" id="ref-for-cookie-name④">name</a>, <a data-link-type="dfn" href="#cookie-domain" id="ref-for-cookie-domain①">domain</a>, and <a data-link-type="dfn" href="#cookie-path" id="ref-for-cookie-path①">path</a> is ignored.</p>
     <li data-md>
      <p>A newly-created <a data-link-type="dfn" href="#cookie" id="ref-for-cookie⑨">cookie</a> which is not immediately evicted is considered <em>changed</em>.</p>
     <li data-md>
      <p>A newly-created <a data-link-type="dfn" href="#cookie" id="ref-for-cookie①⓪">cookie</a> which is immediately evicted is considered <em>deleted</em>.</p>
     <li data-md>
      <p>A <a data-link-type="dfn" href="#cookie" id="ref-for-cookie①①">cookie</a> which is otherwise evicted or removed is considered <em>deleted</em></p>
    </ul>
   </div>
   <div class="algorithm">
    <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="fire-a-change-event">fire a change event</dfn> named <var>type</var> with <var>changes</var> at <var>target</var>, run the following steps:</p>
    <ol>
     <li data-md>
      <p>Let <var>event</var> be the result of <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-create" id="ref-for-concept-event-create">creating an Event</a> using <code class="idl"><a data-link-type="idl" href="#cookiechangeevent" id="ref-for-cookiechangeevent②">CookieChangeEvent</a></code>.</p>
     <li data-md>
      <p>Set <var>event</var>’s <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dom-event-type" id="ref-for-dom-event-type">type</a></code> attribute to <var>type</var>.</p>
     <li data-md>
      <p>Set <var>event</var>’s <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dom-event-bubbles" id="ref-for-dom-event-bubbles">bubbles</a></code> and <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dom-event-cancelable" id="ref-for-dom-event-cancelable">cancelable</a></code> attributes to false.</p>
     <li data-md>
      <p>Let <var>changedList</var> and <var>deletedList</var> be the result of running <a data-link-type="dfn" href="#prepare-lists" id="ref-for-prepare-lists①">prepare lists</a> using <var>changes</var> for <var>target</var>.</p>
     <li data-md>
      <p>Set <var>event</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookiechangeevent-changed" id="ref-for-dom-cookiechangeevent-changed①">changed</a></code> attribute to <var>changedList</var>.</p>
     <li data-md>
      <p>Set <var>event</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookiechangeevent-deleted" id="ref-for-dom-cookiechangeevent-deleted①">deleted</a></code> attribute to <var>deletedList</var>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-dispatch" id="ref-for-concept-event-dispatch②">Dispatch</a> <var>event</var> at <var>target</var>.</p>
    </ol>
   </div>
   <div class="algorithm">
    <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="prepare-lists">prepare lists</dfn> using <var>changes</var> for <var>target</var>, run the following steps:</p>
    <ol>
     <li data-md>
      <p>Let <var>changedList</var> be a new <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list④">list</a>.</p>
     <li data-md>
      <p>Let <var>deletedList</var> be a new <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list⑤">list</a>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate⑤">For each</a> <var>change</var> in <var>changes</var>, run these steps:</p>
      <ol>
       <li data-md>
        <p>Let <var>item</var> be the result of running <a data-link-type="dfn" href="#create-a-cookielistitem" id="ref-for-create-a-cookielistitem①">create a CookieListItem</a> from <var>change</var>’s cookie.</p>
       <li data-md>
        <p>If <var>change</var>’s type is <em>changed</em>, then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append⑧">append</a> <var>item</var> to <var>changedList</var>.</p>
       <li data-md>
        <p>Otherwise, run these steps:</p>
        <ol>
         <li data-md>
          <p>Set <var>item</var>’s <code class="idl"><a data-link-type="idl" href="#dom-cookielistitem-value" id="ref-for-dom-cookielistitem-value①">value</a></code> dictionary member to undefined.</p>
         <li data-md>
          <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append⑨">Append</a> <var>item</var> to <var>deletedList</var>.</p>
        </ol>
      </ol>
     <li data-md>
      <p>Return <var>changedList</var> and <var>deletedList</var>.</p>
    </ol>
   </div>
   <h2 class="heading settled" data-level="7" id="security"><span class="secno">7. </span><span class="content">Security</span><a class="self-link" href="#security"></a></h2>
   <p>Other than cookie access from service worker contexts, this API is not intended to expose any new capabilities to the web.</p>
   <h3 class="heading settled" data-level="7.1" id="gotcha"><span class="secno">7.1. </span><span class="content">Gotcha!</span><a class="self-link" href="#gotcha"></a></h3>
   <p>Although browser cookie implementations are now evolving in the direction of better security and fewer surprising and error-prone defaults, there are at present few guarantees about cookie data security.</p>
   <ul>
    <li data-md>
     <p>unsecured origins can typically overwrite cookies used on secure origins</p>
    <li data-md>
     <p>superdomains can typically overwrite cookies seen by subdomains</p>
    <li data-md>
     <p>cross-site scripting attacts and other script and header injection attacks can be used to forge cookies too</p>
    <li data-md>
     <p>cookie read operations (both from script and on web servers) don’t give any indication of where the cookie came from</p>
    <li data-md>
     <p>browsers sometimes truncate, transform or evict cookie data in surprising and counterintuitive ways</p>
     <ul>
      <li data-md>
       <p>... due to reaching storage limits</p>
      <li data-md>
       <p>... due to character encoding differences</p>
      <li data-md>
       <p>... due to differing syntactic and semantic rules for cookies</p>
     </ul>
   </ul>
   <p>For these reasons it is best to use caution when interpreting any cookie’s value, and never execute a cookie’s value as script, HTML, CSS, XML, PDF, or any other executable format.</p>
   <h3 class="heading settled" data-level="7.2" id="restrict"><span class="secno">7.2. </span><span class="content">Restrict?</span><a class="self-link" href="#restrict"></a></h3>
   <p>This API may have the unintended side-effect of making cookies easier to use and consequently encouraging their further use. If it causes their further use in unsecured <code>http</code> contexts this could result in a web less safe for users. For that reason it may be desirable to restrict its use, or at least the use of the <code>set</code> and <code>delete</code> operations, to secure origins running in secure contexts.</p>
   <h3 class="heading settled" data-level="7.3" id="surprises"><span class="secno">7.3. </span><span class="content">Surprises</span><a class="self-link" href="#surprises"></a></h3>
   <p>Some existing cookie behavior (especially domain-rather-than-origin orientation, unsecured contexts being able to set cookies readable in secure contexts, and script being able to set cookies unreadable from script contexts) may be quite surprising from a web security standpoint.</p>
   <p>Other surprises are documented in <a href="https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-1">Section 1 of Cookies: HTTP State Management Mechanism (RFC 6265bis)</a> - for instance, a cookie may be set for a superdomain (e.g. app.example.com may set a cookie for the whole example.com domain), and a cookie may be readable across all port numbers on a given domain name.</p>
   <p>Further complicating this are historical differences in cookie-handling across major browsers, although some of those (e.g. port number handling) are now handled with more consistency than they once were.</p>
   <h3 class="heading settled" data-level="7.4" id="prefixes"><span class="secno">7.4. </span><span class="content">Prefixes</span><a class="self-link" href="#prefixes"></a></h3>
   <p>Where feasible the examples use the <code>__Host-</code> and <code>__Secure-</code> name prefixes which causes some current browsers to disallow overwriting from unsecured contexts, disallow overwriting with no <code>Secure</code> flag, and — in the case of <code>__Host-</code> — disallow overwriting with an explicit <code>Domain</code> or non-'/' <code>Path</code> attribute (effectively enforcing same-origin semantics.) These prefixes provide important security benefits in those browsers implementing Secure Cookies and degrade gracefully (i.e. the special semantics may not be enforced in other cookie APIs but the cookies work normally and the async cookies API enforces the secure semantics for write operations) in other browsers. A major goal of this API is interoperation with existing cookies, though, so a few examples have also been provided using cookie names lacking these prefixes.</p>
   <p>Prefix rules are also enforced in write operations by this API, but may not be enforced in the same browser for other APIs. For this reason it is inadvisable to rely on their enforcement too heavily until and unless they are more broadly adopted.</p>
   <h3 class="heading settled" data-level="7.5" id="url-scoping"><span class="secno">7.5. </span><span class="content">URL scoping</span><a class="self-link" href="#url-scoping"></a></h3>
   <p>Although a service worker script cannot directly access cookies today, it can already use controlled rendering of in-scope HTML and script resources to inject cookie-monitoring code under the remote control of the service worker script. This means that cookie access inside the scope of the service worker is technically possible already, it’s just not very convenient.</p>
   <p>When the service worker is scoped more narrowly than <code>/</code> it may still be able to read path-scoped cookies from outside its scope’s path space by successfully guessing/constructing a 404 page URL which allows IFRAME-ing and then running script inside it the same technique could expand to the whole origin, but a carefully constructed site (one where no out-of-scope pages are IFRAME-able) can actually deny this capability to a path-scoped service worker today and I was reluctant to remove that restriction without further discussion of the implications.</p>
   <h3 class="heading settled" data-level="7.6" id="aversion"><span class="secno">7.6. </span><span class="content">Cookie aversion</span><a class="self-link" href="#aversion"></a></h3>
   <p>To reduce complexity for developers and eliminate the need for ephemeral test cookies, this async cookies API will explicitly reject attempts to write or delete cookies when the operation would be ignored. Likewise it will explicitly reject attempts to read cookies when that operation would ignore actual cookie data and simulate an empty cookie jar. Attempts to observe cookie changes in these contexts will still "work", but won’t invoke the callback until and unless read access becomes allowed (due e.g. to changed site permissions.)</p>
   <p>Today writing to <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/dom.html#dom-document-cookie" id="ref-for-dom-document-cookie⑦">document.cookie</a></code> in contexts where script-initiated cookie-writing is disallowed typically is a no-op. However, many cookie-writing scripts and frameworks always write a test cookie and then check for its existence to determine whether script-initiated cookie-writing is possible.</p>
   <p>Likewise, today reading <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/dom.html#dom-document-cookie" id="ref-for-dom-document-cookie⑧">document.cookie</a></code> in contexts where script-initiated cookie-reading is disallowed typically returns an empty string. However, a cooperating web server can verify that server-initiated cookie-writing and cookie-reading work and report this to the script (which still sees empty string) and the script can use this information to infer that script-initiated cookie-reading is disallowed.</p>
   <h2 class="heading settled" data-level="8" id="acknowledgements"><span class="secno">8. </span><span class="content">Acknowledgements</span><a class="self-link" href="#acknowledgements"></a></h2>
   <p>Thanks to Benjamin Sittler, who created the initial proposal for this API.</p>
   <p>Many thanks to
Adam Barth,
Alex Russell,
Andrea Marchesini,
Anne van Kesteren,
Ben Kelly,
Craig Francis,
Daniel Murphy,
Domenic Denicola,
Elliott Sprehn,
Fagner Brack,
Jake Archibald,
Joel Weinberger,
Marijn Kruisselbrink, and
Mike West
for helping craft this proposal.</p>
   <p>Special thanks to Tab Atkins, Jr. for creating and maintaining <a href="https://github.com/tabatkins/bikeshed">Bikeshed</a>, the specification
authoring tool used to create this document, and for his general
authoring advice.</p>
  </main>
  <div data-fill-with="conformance">
   <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
   <p> Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology.
            The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL”
            in the normative parts of this document
            are to be interpreted as described in RFC 2119.
            However, for readability,
            these words do not appear in all uppercase letters in this specification. </p>
   <p> All of the text of this specification is normative
            except sections explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
   <p> Examples in this specification are introduced with the words “for example”
            or are set apart from the normative text with <code>class="example"</code>, like this: </p>
   <div class="example" id="example-example"><a class="self-link" href="#example-example"></a> This is an example of an informative example. </div>
   <p> Informative notes begin with the word “Note”
            and are set apart from the normative text with <code>class="note"</code>, like this: </p>
   <p class="note" role="note"> Note, this is an informative note. </p>
  </div>
<script>
(function() {
  "use strict";
  var collapseSidebarText = '<span aria-hidden="true">←</span> '
                          + '<span>Collapse Sidebar</span>';
  var expandSidebarText   = '<span aria-hidden="true">→</span> '
                          + '<span>Pop Out Sidebar</span>';
  var tocJumpText         = '<span aria-hidden="true">↑</span> '
                          + '<span>Jump to Table of Contents</span>';

  var sidebarMedia = window.matchMedia('screen and (min-width: 78em)');
  var autoToggle   = function(e){ toggleSidebar(e.matches) };
  if(sidebarMedia.addListener) {
    sidebarMedia.addListener(autoToggle);
  }

  function toggleSidebar(on) {
    if (on == undefined) {
      on = !document.body.classList.contains('toc-sidebar');
    }

    /* Don’t scroll to compensate for the ToC if we’re above it already. */
    var headY = 0;
    var head = document.querySelector('.head');
    if (head) {
      // terrible approx of "top of ToC"
      headY += head.offsetTop + head.offsetHeight;
    }
    var skipScroll = window.scrollY < headY;

    var toggle = document.getElementById('toc-toggle');
    var tocNav = document.getElementById('toc');
    if (on) {
      var tocHeight = tocNav.offsetHeight;
      document.body.classList.add('toc-sidebar');
      document.body.classList.remove('toc-inline');
      toggle.innerHTML = collapseSidebarText;
      if (!skipScroll) {
        window.scrollBy(0, 0 - tocHeight);
      }
      tocNav.focus();
      sidebarMedia.addListener(autoToggle); // auto-collapse when out of room
    }
    else {
      document.body.classList.add('toc-inline');
      document.body.classList.remove('toc-sidebar');
      toggle.innerHTML = expandSidebarText;
      if (!skipScroll) {
        window.scrollBy(0, tocNav.offsetHeight);
      }
      if (toggle.matches(':hover')) {
        /* Unfocus button when not using keyboard navigation,
           because I don’t know where else to send the focus. */
        toggle.blur();
      }
    }
  }

  function createSidebarToggle() {
    /* Create the sidebar toggle in JS; it shouldn’t exist when JS is off. */
    var toggle = document.createElement('a');
      /* This should probably be a button, but appearance isn’t standards-track.*/
    toggle.id = 'toc-toggle';
    toggle.class = 'toc-toggle';
    toggle.href = '#toc';
    toggle.innerHTML = collapseSidebarText;

    sidebarMedia.addListener(autoToggle);
    var toggler = function(e) {
      e.preventDefault();
      sidebarMedia.removeListener(autoToggle); // persist explicit off states
      toggleSidebar();
      return false;
    }
    toggle.addEventListener('click', toggler, false);


    /* Get <nav id=toc-nav>, or make it if we don’t have one. */
    var tocNav = document.getElementById('toc-nav');
    if (!tocNav) {
      tocNav = document.createElement('p');
      tocNav.id = 'toc-nav';
      /* Prepend for better keyboard navigation */
      document.body.insertBefore(tocNav, document.body.firstChild);
    }
    /* While we’re at it, make sure we have a Jump to Toc link. */
    var tocJump = document.getElementById('toc-jump');
    if (!tocJump) {
      tocJump = document.createElement('a');
      tocJump.id = 'toc-jump';
      tocJump.href = '#toc';
      tocJump.innerHTML = tocJumpText;
      tocNav.appendChild(tocJump);
    }

    tocNav.appendChild(toggle);
  }

  var toc = document.getElementById('toc');
  if (toc) {
    createSidebarToggle();
    toggleSidebar(sidebarMedia.matches);

    /* If the sidebar has been manually opened and is currently overlaying the text
       (window too small for the MQ to add the margin to body),
       then auto-close the sidebar once you click on something in there. */
    toc.addEventListener('click', function(e) {
      if(e.target.tagName.toLowerCase() == "a" && document.body.classList.contains('toc-sidebar') && !sidebarMedia.matches) {
        toggleSidebar(false);
      }
    }, false);
  }
  else {
    console.warn("Can’t find Table of Contents. Please use <nav id='toc'> around the ToC.");
  }

  /* Wrap tables in case they overflow */
  var tables = document.querySelectorAll(':not(.overlarge) > table.data, :not(.overlarge) > table.index');
  var numTables = tables.length;
  for (var i = 0; i < numTables; i++) {
    var table = tables[i];
    var wrapper = document.createElement('div');
    wrapper.className = 'overlarge';
    table.parentNode.insertBefore(wrapper, table);
    wrapper.appendChild(table);
  }

})();
</script>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li><a href="#as-a-timestamp">as a timestamp</a><span>, in §6.1</span>
   <li>
    changed
    <ul>
     <li><a href="#dom-cookiechangeevent-changed">attribute for CookieChangeEvent</a><span>, in §4.1</span>
     <li><a href="#dom-extendablecookiechangeevent-changed">attribute for ExtendableCookieChangeEvent</a><span>, in §4.2</span>
     <li><a href="#dom-cookiechangeeventinit-changed">dict-member for CookieChangeEventInit</a><span>, in §4.1</span>
     <li><a href="#dom-extendablecookiechangeeventinit-changed">dict-member for ExtendableCookieChangeEventInit</a><span>, in §4.2</span>
    </ul>
   <li>
    constructor(type)
    <ul>
     <li><a href="#dom-cookiechangeevent-cookiechangeevent">constructor for CookieChangeEvent</a><span>, in §4.1</span>
     <li><a href="#dom-extendablecookiechangeevent-extendablecookiechangeevent">constructor for ExtendableCookieChangeEvent</a><span>, in §4.2</span>
    </ul>
   <li>
    constructor(type, eventInitDict)
    <ul>
     <li><a href="#dom-cookiechangeevent-cookiechangeevent">constructor for CookieChangeEvent</a><span>, in §4.1</span>
     <li><a href="#dom-extendablecookiechangeevent-extendablecookiechangeevent">constructor for ExtendableCookieChangeEvent</a><span>, in §4.2</span>
    </ul>
   <li><a href="#cookie">cookie</a><span>, in §2.1</span>
   <li><a href="#cookie-change">cookie change</a><span>, in §6.4</span>
   <li><a href="#cookiechangeevent">CookieChangeEvent</a><span>, in §4.1</span>
   <li><a href="#dictdef-cookiechangeeventinit">CookieChangeEventInit</a><span>, in §4.1</span>
   <li><a href="#dom-cookiechangeevent-cookiechangeevent">CookieChangeEvent(type)</a><span>, in §4.1</span>
   <li><a href="#dom-cookiechangeevent-cookiechangeevent">CookieChangeEvent(type, eventInitDict)</a><span>, in §4.1</span>
   <li><a href="#cookie-change-subscription">cookie change subscription</a><span>, in §2.3</span>
   <li><a href="#cookie-change-subscription-list">cookie change subscription list</a><span>, in §2.3</span>
   <li><a href="#typedefdef-cookielist">CookieList</a><span>, in §3</span>
   <li><a href="#dictdef-cookielistitem">CookieListItem</a><span>, in §3</span>
   <li><a href="#enumdef-cookiematchtype">CookieMatchType</a><span>, in §3</span>
   <li><a href="#enumdef-cookiesamesite">CookieSameSite</a><span>, in §3</span>
   <li>
    cookieStore
    <ul>
     <li><a href="#dom-serviceworkerglobalscope-cookiestore">attribute for ServiceWorkerGlobalScope</a><span>, in §5.2</span>
     <li><a href="#dom-window-cookiestore">attribute for Window</a><span>, in §5.1</span>
    </ul>
   <li><a href="#cookiestore">CookieStore</a><span>, in §3</span>
   <li><a href="#cookie-store">cookie store</a><span>, in §2.2</span>
   <li><a href="#dictdef-cookiestoredeleteoptions">CookieStoreDeleteOptions</a><span>, in §3</span>
   <li><a href="#dictdef-cookiestoregetoptions">CookieStoreGetOptions</a><span>, in §3</span>
   <li><a href="#dictdef-cookiestoresetextraoptions">CookieStoreSetExtraOptions</a><span>, in §3</span>
   <li><a href="#dictdef-cookiestoresetoptions">CookieStoreSetOptions</a><span>, in §3</span>
   <li><a href="#create-a-cookielistitem">create a CookieListItem</a><span>, in §6.1</span>
   <li><a href="#cookie-creation-time">creation-time</a><span>, in §2.1</span>
   <li><a href="#date-serialize">date serialize</a><span>, in §6.2</span>
   <li><a href="#decode">decode</a><span>, in §6</span>
   <li><a href="#delete-a-cookie">delete a cookie</a><span>, in §6.3</span>
   <li>
    deleted
    <ul>
     <li><a href="#dom-cookiechangeevent-deleted">attribute for CookieChangeEvent</a><span>, in §4.1</span>
     <li><a href="#dom-extendablecookiechangeevent-deleted">attribute for ExtendableCookieChangeEvent</a><span>, in §4.2</span>
     <li><a href="#dom-cookiechangeeventinit-deleted">dict-member for CookieChangeEventInit</a><span>, in §4.1</span>
     <li><a href="#dom-extendablecookiechangeeventinit-deleted">dict-member for ExtendableCookieChangeEventInit</a><span>, in §4.2</span>
    </ul>
   <li><a href="#dom-cookiestore-delete">delete(name)</a><span>, in §3.4</span>
   <li><a href="#dom-cookiestore-delete-options">delete(options)</a><span>, in §3.4</span>
   <li>
    domain
    <ul>
     <li><a href="#cookie-domain">dfn for cookie</a><span>, in §2.1</span>
     <li><a href="#dom-cookielistitem-domain">dict-member for CookieListItem</a><span>, in §3</span>
     <li><a href="#dom-cookiestoredeleteoptions-domain">dict-member for CookieStoreDeleteOptions</a><span>, in §3</span>
     <li><a href="#dom-cookiestoresetoptions-domain">dict-member for CookieStoreSetOptions</a><span>, in §3</span>
    </ul>
   <li><a href="#encode">encode</a><span>, in §6</span>
   <li><a href="#dom-cookiematchtype-equals">"equals"</a><span>, in §3</span>
   <li>
    expires
    <ul>
     <li><a href="#dom-cookielistitem-expires">dict-member for CookieListItem</a><span>, in §3</span>
     <li><a href="#dom-cookiestoresetoptions-expires">dict-member for CookieStoreSetOptions</a><span>, in §3</span>
    </ul>
   <li><a href="#cookie-expiry-time">expiry-time</a><span>, in §2.1</span>
   <li><a href="#extendablecookiechangeevent">ExtendableCookieChangeEvent</a><span>, in §4.2</span>
   <li><a href="#dictdef-extendablecookiechangeeventinit">ExtendableCookieChangeEventInit</a><span>, in §4.2</span>
   <li><a href="#dom-extendablecookiechangeevent-extendablecookiechangeevent">ExtendableCookieChangeEvent(type)</a><span>, in §4.2</span>
   <li><a href="#dom-extendablecookiechangeevent-extendablecookiechangeevent">ExtendableCookieChangeEvent(type, eventInitDict)</a><span>, in §4.2</span>
   <li><a href="#fire-a-change-event">fire a change event</a><span>, in §6.4</span>
   <li><a href="#dom-cookiestore-get-options">get()</a><span>, in §3.1</span>
   <li><a href="#dom-cookiestore-getall-options">getAll()</a><span>, in §3.2</span>
   <li><a href="#dom-cookiestore-getall">getAll(name)</a><span>, in §3.2</span>
   <li><a href="#dom-cookiestore-getall-options">getAll(options)</a><span>, in §3.2</span>
   <li><a href="#dom-cookiestore-getchangesubscriptions">getChangeSubscriptions()</a><span>, in §3.6</span>
   <li><a href="#dom-cookiestore-get">get(name)</a><span>, in §3.1</span>
   <li><a href="#dom-cookiestore-get-options">get(options)</a><span>, in §3.1</span>
   <li><a href="#cookie-host-only-flag">host-only-flag</a><span>, in §2.1</span>
   <li><a href="#cookie-http-only-flag">http-only-flag</a><span>, in §2.1</span>
   <li><a href="#cookie-last-access-time">last-access-time</a><span>, in §2.1</span>
   <li><a href="#dom-cookiesamesite-lax">"lax"</a><span>, in §3</span>
   <li><a href="#matches">matches</a><span>, in §6.1</span>
   <li>
    matchType
    <ul>
     <li><a href="#cookie-change-subscription-matchtype">dfn for cookie change subscription</a><span>, in §2.3</span>
     <li><a href="#dom-cookiestoregetoptions-matchtype">dict-member for CookieStoreGetOptions</a><span>, in §3</span>
    </ul>
   <li>
    name
    <ul>
     <li><a href="#cookie-name">dfn for cookie</a><span>, in §2.1</span>
     <li><a href="#cookie-change-subscription-name">dfn for cookie change subscription</a><span>, in §2.3</span>
     <li><a href="#dom-cookielistitem-name">dict-member for CookieListItem</a><span>, in §3</span>
     <li><a href="#dom-cookiestoredeleteoptions-name">dict-member for CookieStoreDeleteOptions</a><span>, in §3</span>
     <li><a href="#dom-cookiestoregetoptions-name">dict-member for CookieStoreGetOptions</a><span>, in §3</span>
     <li><a href="#dom-cookiestoresetextraoptions-name">dict-member for CookieStoreSetExtraOptions</a><span>, in §3</span>
    </ul>
   <li><a href="#dom-cookiesamesite-none">"none"</a><span>, in §3</span>
   <li><a href="#observable-changes">observable changes</a><span>, in §6.4</span>
   <li><a href="#dom-cookiestore-onchange">onchange</a><span>, in §3</span>
   <li><a href="#dom-serviceworkerglobalscope-oncookiechange">oncookiechange</a><span>, in §5.2</span>
   <li>
    path
    <ul>
     <li><a href="#cookie-path">dfn for cookie</a><span>, in §2.1</span>
     <li><a href="#dom-cookielistitem-path">dict-member for CookieListItem</a><span>, in §3</span>
     <li><a href="#dom-cookiestoredeleteoptions-path">dict-member for CookieStoreDeleteOptions</a><span>, in §3</span>
     <li><a href="#dom-cookiestoresetoptions-path">dict-member for CookieStoreSetOptions</a><span>, in §3</span>
    </ul>
   <li><a href="#cookie-persistent-flag">persistent-flag</a><span>, in §2.1</span>
   <li><a href="#prepare-lists">prepare lists</a><span>, in §6.4</span>
   <li><a href="#process-cookie-changes">process cookie changes</a><span>, in §6.4</span>
   <li><a href="#query-cookies">query cookies</a><span>, in §6.1</span>
   <li>
    sameSite
    <ul>
     <li><a href="#dom-cookielistitem-samesite">dict-member for CookieListItem</a><span>, in §3</span>
     <li><a href="#dom-cookiestoresetoptions-samesite">dict-member for CookieStoreSetOptions</a><span>, in §3</span>
    </ul>
   <li><a href="#cookie-same-site-flag">same-site-flag</a><span>, in §2.1</span>
   <li><a href="#script-visible">script-visible</a><span>, in §1.2.1</span>
   <li>
    secure
    <ul>
     <li><a href="#dom-cookielistitem-secure">dict-member for CookieListItem</a><span>, in §3</span>
     <li><a href="#dom-cookiestoresetoptions-secure">dict-member for CookieStoreSetOptions</a><span>, in §3</span>
    </ul>
   <li><a href="#cookie-secure-only-flag">secure-only-flag</a><span>, in §2.1</span>
   <li><a href="#set-a-cookie">set a cookie</a><span>, in §6.2</span>
   <li><a href="#dom-cookiestore-set">set(name, value)</a><span>, in §3.3</span>
   <li><a href="#dom-cookiestore-set">set(name, value, options)</a><span>, in §3.3</span>
   <li><a href="#dom-cookiestore-set-options">set(options)</a><span>, in §3.3</span>
   <li><a href="#dom-cookiematchtype-starts-with">"starts-with"</a><span>, in §3</span>
   <li><a href="#dom-cookiesamesite-strict">"strict"</a><span>, in §3</span>
   <li><a href="#dom-cookiestore-subscribetochanges">subscribeToChanges(subscriptions)</a><span>, in §3.5</span>
   <li>
    url
    <ul>
     <li><a href="#cookie-change-subscription-url">dfn for cookie change subscription</a><span>, in §2.3</span>
     <li><a href="#dom-cookiestoregetoptions-url">dict-member for CookieStoreGetOptions</a><span>, in §3</span>
    </ul>
   <li>
    value
    <ul>
     <li><a href="#cookie-value">dfn for cookie</a><span>, in §2.1</span>
     <li><a href="#dom-cookielistitem-value">dict-member for CookieListItem</a><span>, in §3</span>
     <li><a href="#dom-cookiestoresetextraoptions-value">dict-member for CookieStoreSetExtraOptions</a><span>, in §3</span>
    </ul>
  </ul>
  <aside class="dfn-panel" data-for="term-for-event">
   <a href="https://dom.spec.whatwg.org/#event">https://dom.spec.whatwg.org/#event</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event">4.1. The CookieChangeEvent interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dictdef-eventinit">
   <a href="https://dom.spec.whatwg.org/#dictdef-eventinit">https://dom.spec.whatwg.org/#dictdef-eventinit</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-eventinit">4.1. The CookieChangeEvent interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-eventtarget">
   <a href="https://dom.spec.whatwg.org/#eventtarget">https://dom.spec.whatwg.org/#eventtarget</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventtarget">3. The CookieStore Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-event-bubbles">
   <a href="https://dom.spec.whatwg.org/#dom-event-bubbles">https://dom.spec.whatwg.org/#dom-event-bubbles</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-event-bubbles">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-event-cancelable">
   <a href="https://dom.spec.whatwg.org/#dom-event-cancelable">https://dom.spec.whatwg.org/#dom-event-cancelable</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-event-cancelable">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-context-object">
   <a href="https://dom.spec.whatwg.org/#context-object">https://dom.spec.whatwg.org/#context-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-context-object">3.1. The get() method</a>
    <li><a href="#ref-for-context-object①">3.2. The getAll() method</a>
    <li><a href="#ref-for-context-object②">3.5. The subscribeToChanges() method</a> <a href="#ref-for-context-object③">(2)</a>
    <li><a href="#ref-for-context-object④">3.6. The getChangeSubscriptions() method</a>
    <li><a href="#ref-for-context-object⑤">5.1. The Window interface</a>
    <li><a href="#ref-for-context-object⑥">5.2. The ServiceWorkerGlobalScope interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-event-create">
   <a href="https://dom.spec.whatwg.org/#concept-event-create">https://dom.spec.whatwg.org/#concept-event-create</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-event-create">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-event-dispatch">
   <a href="https://dom.spec.whatwg.org/#concept-event-dispatch">https://dom.spec.whatwg.org/#concept-event-dispatch</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-event-dispatch">4.1. The CookieChangeEvent interface</a>
    <li><a href="#ref-for-concept-event-dispatch①">4.2. The ExtendableCookieChangeEvent interface</a>
    <li><a href="#ref-for-concept-event-dispatch②">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-document">
   <a href="https://dom.spec.whatwg.org/#concept-document">https://dom.spec.whatwg.org/#concept-document</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-document">1.3. Querying Cookies</a> <a href="#ref-for-concept-document①">(2)</a> <a href="#ref-for-concept-document②">(3)</a>
    <li><a href="#ref-for-concept-document③">1.4. Modifying Cookies</a>
    <li><a href="#ref-for-concept-document④">1.5. Monitoring Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-event-type">
   <a href="https://dom.spec.whatwg.org/#dom-event-type">https://dom.spec.whatwg.org/#dom-event-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-event-type">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-promise-objects">
   <a href="https://tc39.github.io/ecma262/#sec-promise-objects">https://tc39.github.io/ecma262/#sec-promise-objects</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-promise-objects">1.3. Querying Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-time-values-and-time-range">
   <a href="https://tc39.github.io/ecma262/#sec-time-values-and-time-range">https://tc39.github.io/ecma262/#sec-time-values-and-time-range</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-time-values-and-time-range">6.1. Query Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-utf-8-decode-without-bom">
   <a href="https://encoding.spec.whatwg.org/#utf-8-decode-without-bom">https://encoding.spec.whatwg.org/#utf-8-decode-without-bom</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-utf-8-decode-without-bom">6. Algorithms</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-utf-8-encode">
   <a href="https://encoding.spec.whatwg.org/#utf-8-encode">https://encoding.spec.whatwg.org/#utf-8-encode</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-utf-8-encode">6. Algorithms</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-fetch">
   <a href="https://fetch.spec.whatwg.org/#concept-fetch">https://fetch.spec.whatwg.org/#concept-fetch</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-fetch">1.3. Querying Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-window">
   <a href="https://fetch.spec.whatwg.org/#concept-request-window">https://fetch.spec.whatwg.org/#concept-request-window</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-window">1.5. Monitoring Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-eventhandler">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler">https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventhandler">3. The CookieStore Interface</a>
    <li><a href="#ref-for-eventhandler①">5.2. The ServiceWorkerGlobalScope interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-window">
   <a href="https://html.spec.whatwg.org/multipage/window-object.html#window">https://html.spec.whatwg.org/multipage/window-object.html#window</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-window">3.1. The get() method</a>
    <li><a href="#ref-for-window①">3.2. The getAll() method</a>
    <li><a href="#ref-for-window②">4.1. The CookieChangeEvent interface</a>
    <li><a href="#ref-for-window③">5. Global Interfaces</a>
    <li><a href="#ref-for-window④">5.1. The Window interface</a> <a href="#ref-for-window⑤">(2)</a>
    <li><a href="#ref-for-window⑥">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-api-base-url">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url">https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-api-base-url">3.1. The get() method</a>
    <li><a href="#ref-for-api-base-url①">3.2. The getAll() method</a>
    <li><a href="#ref-for-api-base-url②">3.5. The subscribeToChanges() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-document-cookie">
   <a href="https://html.spec.whatwg.org/multipage/dom.html#dom-document-cookie">https://html.spec.whatwg.org/multipage/dom.html#dom-document-cookie</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-document-cookie">1. Introduction</a> <a href="#ref-for-dom-document-cookie①">(2)</a>
    <li><a href="#ref-for-dom-document-cookie②">1.2.2. Motivations</a>
    <li><a href="#ref-for-dom-document-cookie③">1.2.4. Compatiblity</a> <a href="#ref-for-dom-document-cookie④">(2)</a> <a href="#ref-for-dom-document-cookie⑤">(3)</a>
    <li><a href="#ref-for-dom-document-cookie⑥">1.3. Querying Cookies</a>
    <li><a href="#ref-for-dom-document-cookie⑦">7.6. Cookie aversion</a> <a href="#ref-for-dom-document-cookie⑧">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-environment-creation-url">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url">https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-environment-creation-url">3.1. The get() method</a> <a href="#ref-for-concept-environment-creation-url①">(2)</a>
    <li><a href="#ref-for-concept-environment-creation-url②">3.2. The getAll() method</a> <a href="#ref-for-concept-environment-creation-url③">(2)</a>
    <li><a href="#ref-for-concept-environment-creation-url④">3.3. The set() method</a> <a href="#ref-for-concept-environment-creation-url⑤">(2)</a>
    <li><a href="#ref-for-concept-environment-creation-url⑥">3.4. The delete() method</a> <a href="#ref-for-concept-environment-creation-url⑦">(2)</a>
    <li><a href="#ref-for-concept-environment-creation-url⑧">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-current-global-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#current-global-object">https://html.spec.whatwg.org/multipage/webappapis.html#current-global-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-current-global-object">3.1. The get() method</a>
    <li><a href="#ref-for-current-global-object①">3.2. The getAll() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-current-settings-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object">https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-current-settings-object">3.1. The get() method</a> <a href="#ref-for-current-settings-object①">(2)</a> <a href="#ref-for-current-settings-object②">(3)</a> <a href="#ref-for-current-settings-object③">(4)</a>
    <li><a href="#ref-for-current-settings-object④">3.2. The getAll() method</a> <a href="#ref-for-current-settings-object⑤">(2)</a> <a href="#ref-for-current-settings-object⑥">(3)</a> <a href="#ref-for-current-settings-object⑦">(4)</a>
    <li><a href="#ref-for-current-settings-object⑧">3.3. The set() method</a> <a href="#ref-for-current-settings-object⑨">(2)</a> <a href="#ref-for-current-settings-object①⓪">(3)</a> <a href="#ref-for-current-settings-object①①">(4)</a>
    <li><a href="#ref-for-current-settings-object①②">3.4. The delete() method</a> <a href="#ref-for-current-settings-object①③">(2)</a> <a href="#ref-for-current-settings-object①④">(3)</a> <a href="#ref-for-current-settings-object①⑤">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-document-domain">
   <a href="https://html.spec.whatwg.org/multipage/origin.html#dom-document-domain">https://html.spec.whatwg.org/multipage/origin.html#dom-document-domain</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-document-domain">3.1. The get() method</a>
    <li><a href="#ref-for-dom-document-domain①">3.2. The getAll() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-settings-object-global">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global">https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-settings-object-global">3.5. The subscribeToChanges() method</a>
    <li><a href="#ref-for-concept-settings-object-global①">3.6. The getChangeSubscriptions() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-in-parallel">
   <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-in-parallel">3.1. The get() method</a> <a href="#ref-for-in-parallel①">(2)</a>
    <li><a href="#ref-for-in-parallel②">3.2. The getAll() method</a> <a href="#ref-for-in-parallel③">(2)</a>
    <li><a href="#ref-for-in-parallel④">3.3. The set() method</a> <a href="#ref-for-in-parallel⑤">(2)</a>
    <li><a href="#ref-for-in-parallel⑥">3.4. The delete() method</a> <a href="#ref-for-in-parallel⑦">(2)</a>
    <li><a href="#ref-for-in-parallel⑧">3.5. The subscribeToChanges() method</a>
    <li><a href="#ref-for-in-parallel⑨">3.6. The getChangeSubscriptions() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-origin-opaque">
   <a href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque">https://html.spec.whatwg.org/multipage/origin.html#concept-origin-opaque</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-origin-opaque">3.1. The get() method</a> <a href="#ref-for-concept-origin-opaque①">(2)</a>
    <li><a href="#ref-for-concept-origin-opaque②">3.2. The getAll() method</a> <a href="#ref-for-concept-origin-opaque③">(2)</a>
    <li><a href="#ref-for-concept-origin-opaque④">3.3. The set() method</a> <a href="#ref-for-concept-origin-opaque⑤">(2)</a>
    <li><a href="#ref-for-concept-origin-opaque⑥">3.4. The delete() method</a> <a href="#ref-for-concept-origin-opaque⑦">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-origin">
   <a href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin">https://html.spec.whatwg.org/multipage/origin.html#concept-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-origin">3.1. The get() method</a> <a href="#ref-for-concept-origin①">(2)</a>
    <li><a href="#ref-for-concept-origin②">3.2. The getAll() method</a> <a href="#ref-for-concept-origin③">(2)</a>
    <li><a href="#ref-for-concept-origin④">3.3. The set() method</a> <a href="#ref-for-concept-origin⑤">(2)</a>
    <li><a href="#ref-for-concept-origin⑥">3.4. The delete() method</a> <a href="#ref-for-concept-origin⑦">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-queue-a-task">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task">https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-queue-a-task">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-relevant-settings-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object">https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-relevant-settings-object">3.1. The get() method</a>
    <li><a href="#ref-for-relevant-settings-object①">3.2. The getAll() method</a>
    <li><a href="#ref-for-relevant-settings-object②">3.5. The subscribeToChanges() method</a>
    <li><a href="#ref-for-relevant-settings-object③">5.1. The Window interface</a>
    <li><a href="#ref-for-relevant-settings-object④">5.2. The ServiceWorkerGlobalScope interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-history-replacestate">
   <a href="https://html.spec.whatwg.org/multipage/history.html#dom-history-replacestate">https://html.spec.whatwg.org/multipage/history.html#dom-history-replacestate</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-history-replacestate">3.1. The get() method</a>
    <li><a href="#ref-for-dom-history-replacestate①">3.2. The getAll() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-responsible-event-loop">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop">https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-responsible-event-loop">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-same-origin">
   <a href="https://html.spec.whatwg.org/multipage/origin.html#same-origin">https://html.spec.whatwg.org/multipage/origin.html#same-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-same-origin">3.1. The get() method</a>
    <li><a href="#ref-for-same-origin①">3.2. The getAll() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-set-append">
   <a href="https://infra.spec.whatwg.org/#set-append">https://infra.spec.whatwg.org/#set-append</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-set-append">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-iteration-break">
   <a href="https://infra.spec.whatwg.org/#iteration-break">https://infra.spec.whatwg.org/#iteration-break</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-iteration-break">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-byte-sequence">
   <a href="https://infra.spec.whatwg.org/#byte-sequence">https://infra.spec.whatwg.org/#byte-sequence</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-byte-sequence">6. Algorithms</a>
    <li><a href="#ref-for-byte-sequence①">6.2. Set a Cookie</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-code-point">
   <a href="https://infra.spec.whatwg.org/#code-point">https://infra.spec.whatwg.org/#code-point</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-code-point">1.2.3. Opinions</a> <a href="#ref-for-code-point①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list-contain">
   <a href="https://infra.spec.whatwg.org/#list-contain">https://infra.spec.whatwg.org/#list-contain</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list-contain">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-iteration-continue">
   <a href="https://infra.spec.whatwg.org/#iteration-continue">https://infra.spec.whatwg.org/#iteration-continue</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-iteration-continue">6.1. Query Cookies</a>
    <li><a href="#ref-for-iteration-continue①">6.4. Process Changes</a> <a href="#ref-for-iteration-continue②">(2)</a> <a href="#ref-for-iteration-continue③">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list-iterate">
   <a href="https://infra.spec.whatwg.org/#list-iterate">https://infra.spec.whatwg.org/#list-iterate</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list-iterate">3.5. The subscribeToChanges() method</a>
    <li><a href="#ref-for-list-iterate①">3.6. The getChangeSubscriptions() method</a>
    <li><a href="#ref-for-list-iterate②">6.1. Query Cookies</a>
    <li><a href="#ref-for-list-iterate③">6.4. Process Changes</a> <a href="#ref-for-list-iterate④">(2)</a> <a href="#ref-for-list-iterate⑤">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list-is-empty">
   <a href="https://infra.spec.whatwg.org/#list-is-empty">https://infra.spec.whatwg.org/#list-is-empty</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list-is-empty">3.1. The get() method</a> <a href="#ref-for-list-is-empty①">(2)</a>
    <li><a href="#ref-for-list-is-empty②">6.4. Process Changes</a> <a href="#ref-for-list-is-empty③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-string-length">
   <a href="https://infra.spec.whatwg.org/#string-length">https://infra.spec.whatwg.org/#string-length</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-string-length">6.2. Set a Cookie</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list">
   <a href="https://infra.spec.whatwg.org/#list">https://infra.spec.whatwg.org/#list</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list">2.3. Extensions to Service Worker</a>
    <li><a href="#ref-for-list①">3.6. The getChangeSubscriptions() method</a>
    <li><a href="#ref-for-list②">6.1. Query Cookies</a>
    <li><a href="#ref-for-list③">6.2. Set a Cookie</a>
    <li><a href="#ref-for-list④">6.4. Process Changes</a> <a href="#ref-for-list⑤">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-ordered-set">
   <a href="https://infra.spec.whatwg.org/#ordered-set">https://infra.spec.whatwg.org/#ordered-set</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-ordered-set">6.4. Process Changes</a> <a href="#ref-for-ordered-set①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-tuple">
   <a href="https://infra.spec.whatwg.org/#tuple">https://infra.spec.whatwg.org/#tuple</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-tuple">2.3. Extensions to Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-a-new-promise">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise">https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-a-new-promise">3.1. The get() method</a> <a href="#ref-for-a-new-promise①">(2)</a>
    <li><a href="#ref-for-a-new-promise②">3.2. The getAll() method</a> <a href="#ref-for-a-new-promise③">(2)</a>
    <li><a href="#ref-for-a-new-promise④">3.3. The set() method</a> <a href="#ref-for-a-new-promise⑤">(2)</a>
    <li><a href="#ref-for-a-new-promise⑥">3.4. The delete() method</a> <a href="#ref-for-a-new-promise⑦">(2)</a>
    <li><a href="#ref-for-a-new-promise⑧">3.5. The subscribeToChanges() method</a>
    <li><a href="#ref-for-a-new-promise⑨">3.6. The getChangeSubscriptions() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-a-promise-rejected-with">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with">https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-a-promise-rejected-with">3.1. The get() method</a> <a href="#ref-for-a-promise-rejected-with①">(2)</a> <a href="#ref-for-a-promise-rejected-with②">(3)</a> <a href="#ref-for-a-promise-rejected-with③">(4)</a>
    <li><a href="#ref-for-a-promise-rejected-with④">3.2. The getAll() method</a> <a href="#ref-for-a-promise-rejected-with⑤">(2)</a> <a href="#ref-for-a-promise-rejected-with⑥">(3)</a> <a href="#ref-for-a-promise-rejected-with⑦">(4)</a>
    <li><a href="#ref-for-a-promise-rejected-with⑧">3.3. The set() method</a> <a href="#ref-for-a-promise-rejected-with⑨">(2)</a>
    <li><a href="#ref-for-a-promise-rejected-with①⓪">3.4. The delete() method</a> <a href="#ref-for-a-promise-rejected-with①①">(2)</a>
    <li><a href="#ref-for-a-promise-rejected-with①②">3.5. The subscribeToChanges() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-reject-promise">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise">https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-reject-promise">3.1. The get() method</a> <a href="#ref-for-reject-promise①">(2)</a>
    <li><a href="#ref-for-reject-promise②">3.2. The getAll() method</a> <a href="#ref-for-reject-promise③">(2)</a>
    <li><a href="#ref-for-reject-promise④">3.3. The set() method</a> <a href="#ref-for-reject-promise⑤">(2)</a>
    <li><a href="#ref-for-reject-promise⑥">3.4. The delete() method</a> <a href="#ref-for-reject-promise⑦">(2)</a>
    <li><a href="#ref-for-reject-promise⑧">3.5. The subscribeToChanges() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-extendableevent">
   <a href="https://w3c.github.io/ServiceWorker/#extendableevent">https://w3c.github.io/ServiceWorker/#extendableevent</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extendableevent">4.2. The ExtendableCookieChangeEvent interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dictdef-extendableeventinit">
   <a href="https://w3c.github.io/ServiceWorker/#dictdef-extendableeventinit">https://w3c.github.io/ServiceWorker/#dictdef-extendableeventinit</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-extendableeventinit">4.2. The ExtendableCookieChangeEvent interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-serviceworkerglobalscope">
   <a href="https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope">https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-serviceworkerglobalscope">4.2. The ExtendableCookieChangeEvent interface</a>
    <li><a href="#ref-for-serviceworkerglobalscope①">5. Global Interfaces</a>
    <li><a href="#ref-for-serviceworkerglobalscope②">5.2. The ServiceWorkerGlobalScope interface</a> <a href="#ref-for-serviceworkerglobalscope③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-containing-service-worker-registration">
   <a href="https://w3c.github.io/ServiceWorker/#dfn-containing-service-worker-registration">https://w3c.github.io/ServiceWorker/#dfn-containing-service-worker-registration</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-containing-service-worker-registration">3.5. The subscribeToChanges() method</a>
    <li><a href="#ref-for-dfn-containing-service-worker-registration①">3.6. The getChangeSubscriptions() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-fire-functional-event">
   <a href="https://w3c.github.io/ServiceWorker/#fire-functional-event">https://w3c.github.io/ServiceWorker/#fire-functional-event</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fire-functional-event">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-scope-url">
   <a href="https://w3c.github.io/ServiceWorker/#dfn-scope-url">https://w3c.github.io/ServiceWorker/#dfn-scope-url</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-scope-url">1.3. Querying Cookies</a>
    <li><a href="#ref-for-dfn-scope-url①">3.5. The subscribeToChanges() method</a>
    <li><a href="#ref-for-dfn-scope-url②">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-service-worker">
   <a href="https://w3c.github.io/ServiceWorker/#dfn-service-worker">https://w3c.github.io/ServiceWorker/#dfn-service-worker</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker">1.3. Querying Cookies</a> <a href="#ref-for-dfn-service-worker①">(2)</a> <a href="#ref-for-dfn-service-worker②">(3)</a>
    <li><a href="#ref-for-dfn-service-worker③">1.4. Modifying Cookies</a>
    <li><a href="#ref-for-dfn-service-worker④">1.5. Monitoring Cookies</a> <a href="#ref-for-dfn-service-worker⑤">(2)</a> <a href="#ref-for-dfn-service-worker⑥">(3)</a> <a href="#ref-for-dfn-service-worker⑦">(4)</a> <a href="#ref-for-dfn-service-worker⑧">(5)</a>
    <li><a href="#ref-for-dfn-service-worker⑨">3.5. The subscribeToChanges() method</a> <a href="#ref-for-dfn-service-worker①⓪">(2)</a> <a href="#ref-for-dfn-service-worker①①">(3)</a>
    <li><a href="#ref-for-dfn-service-worker①②">3.6. The getChangeSubscriptions() method</a>
    <li><a href="#ref-for-dfn-service-worker①③">4.2. The ExtendableCookieChangeEvent interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-service-worker-registration">
   <a href="https://w3c.github.io/ServiceWorker/#dfn-service-worker-registration">https://w3c.github.io/ServiceWorker/#dfn-service-worker-registration</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker-registration">1.5. Monitoring Cookies</a>
    <li><a href="#ref-for-dfn-service-worker-registration①">2.3. Extensions to Service Worker</a> <a href="#ref-for-dfn-service-worker-registration②">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-registration③">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-state">
   <a href="https://w3c.github.io/ServiceWorker/#dfn-state">https://w3c.github.io/ServiceWorker/#dfn-state</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-state">1.5. Monitoring Cookies</a> <a href="#ref-for-dfn-state①">(2)</a>
    <li><a href="#ref-for-dfn-state②">3.5. The subscribeToChanges() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-basic-url-parser">
   <a href="https://url.spec.whatwg.org/#concept-basic-url-parser">https://url.spec.whatwg.org/#concept-basic-url-parser</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-basic-url-parser">3.1. The get() method</a>
    <li><a href="#ref-for-concept-basic-url-parser①">3.2. The getAll() method</a>
    <li><a href="#ref-for-concept-basic-url-parser②">3.5. The subscribeToChanges() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url-equals">
   <a href="https://url.spec.whatwg.org/#concept-url-equals">https://url.spec.whatwg.org/#concept-url-equals</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url-equals">3.1. The get() method</a>
    <li><a href="#ref-for-concept-url-equals①">3.2. The getAll() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url-host">
   <a href="https://url.spec.whatwg.org/#concept-url-host">https://url.spec.whatwg.org/#concept-url-host</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url-host">6.2. Set a Cookie</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url-origin">
   <a href="https://url.spec.whatwg.org/#concept-url-origin">https://url.spec.whatwg.org/#concept-url-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url-origin">3.1. The get() method</a> <a href="#ref-for-concept-url-origin①">(2)</a>
    <li><a href="#ref-for-concept-url-origin②">3.2. The getAll() method</a> <a href="#ref-for-concept-url-origin③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-DOMException">
   <a href="https://heycam.github.io/webidl/#idl-DOMException">https://heycam.github.io/webidl/#idl-DOMException</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-DOMException">3.1. The get() method</a> <a href="#ref-for-idl-DOMException①">(2)</a>
    <li><a href="#ref-for-idl-DOMException②">3.2. The getAll() method</a> <a href="#ref-for-idl-DOMException③">(2)</a>
    <li><a href="#ref-for-idl-DOMException④">3.3. The set() method</a> <a href="#ref-for-idl-DOMException⑤">(2)</a>
    <li><a href="#ref-for-idl-DOMException⑥">3.4. The delete() method</a> <a href="#ref-for-idl-DOMException⑦">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-DOMString">
   <a href="https://heycam.github.io/webidl/#idl-DOMString">https://heycam.github.io/webidl/#idl-DOMString</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-DOMString">4.1. The CookieChangeEvent interface</a>
    <li><a href="#ref-for-idl-DOMString①">4.2. The ExtendableCookieChangeEvent interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-DOMTimeStamp">
   <a href="https://heycam.github.io/webidl/#DOMTimeStamp">https://heycam.github.io/webidl/#DOMTimeStamp</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-DOMTimeStamp">3. The CookieStore Interface</a> <a href="#ref-for-DOMTimeStamp①">(2)</a>
    <li><a href="#ref-for-DOMTimeStamp②">6.2. Set a Cookie</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-Exposed">
   <a href="https://heycam.github.io/webidl/#Exposed">https://heycam.github.io/webidl/#Exposed</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-Exposed">3. The CookieStore Interface</a> <a href="#ref-for-Exposed①">(2)</a> <a href="#ref-for-Exposed②">(3)</a> <a href="#ref-for-Exposed③">(4)</a>
    <li><a href="#ref-for-Exposed④">4.1. The CookieChangeEvent interface</a>
    <li><a href="#ref-for-Exposed⑤">4.2. The ExtendableCookieChangeEvent interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-Replaceable">
   <a href="https://heycam.github.io/webidl/#Replaceable">https://heycam.github.io/webidl/#Replaceable</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-Replaceable">5.1. The Window interface</a>
    <li><a href="#ref-for-Replaceable①">5.2. The ServiceWorkerGlobalScope interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-SameObject">
   <a href="https://heycam.github.io/webidl/#SameObject">https://heycam.github.io/webidl/#SameObject</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-SameObject">5.1. The Window interface</a>
    <li><a href="#ref-for-SameObject①">5.2. The ServiceWorkerGlobalScope interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-SecureContext">
   <a href="https://heycam.github.io/webidl/#SecureContext">https://heycam.github.io/webidl/#SecureContext</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-SecureContext">3. The CookieStore Interface</a>
    <li><a href="#ref-for-SecureContext①">4.1. The CookieChangeEvent interface</a>
    <li><a href="#ref-for-SecureContext②">5.1. The Window interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-securityerror">
   <a href="https://heycam.github.io/webidl/#securityerror">https://heycam.github.io/webidl/#securityerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-securityerror">3.1. The get() method</a> <a href="#ref-for-securityerror①">(2)</a>
    <li><a href="#ref-for-securityerror②">3.2. The getAll() method</a> <a href="#ref-for-securityerror③">(2)</a>
    <li><a href="#ref-for-securityerror④">3.3. The set() method</a> <a href="#ref-for-securityerror⑤">(2)</a>
    <li><a href="#ref-for-securityerror⑥">3.4. The delete() method</a> <a href="#ref-for-securityerror⑦">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-exceptiondef-typeerror">
   <a href="https://heycam.github.io/webidl/#exceptiondef-typeerror">https://heycam.github.io/webidl/#exceptiondef-typeerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exceptiondef-typeerror">3.1. The get() method</a> <a href="#ref-for-exceptiondef-typeerror①">(2)</a> <a href="#ref-for-exceptiondef-typeerror②">(3)</a> <a href="#ref-for-exceptiondef-typeerror③">(4)</a>
    <li><a href="#ref-for-exceptiondef-typeerror④">3.2. The getAll() method</a> <a href="#ref-for-exceptiondef-typeerror⑤">(2)</a> <a href="#ref-for-exceptiondef-typeerror⑥">(3)</a> <a href="#ref-for-exceptiondef-typeerror⑦">(4)</a>
    <li><a href="#ref-for-exceptiondef-typeerror⑧">3.3. The set() method</a> <a href="#ref-for-exceptiondef-typeerror⑨">(2)</a>
    <li><a href="#ref-for-exceptiondef-typeerror①⓪">3.4. The delete() method</a> <a href="#ref-for-exceptiondef-typeerror①①">(2)</a>
    <li><a href="#ref-for-exceptiondef-typeerror①②">3.5. The subscribeToChanges() method</a> <a href="#ref-for-exceptiondef-typeerror①③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-USVString">
   <a href="https://heycam.github.io/webidl/#idl-USVString">https://heycam.github.io/webidl/#idl-USVString</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-USVString">1.2.4. Compatiblity</a>
    <li><a href="#ref-for-idl-USVString①">3. The CookieStore Interface</a> <a href="#ref-for-idl-USVString②">(2)</a> <a href="#ref-for-idl-USVString③">(3)</a> <a href="#ref-for-idl-USVString④">(4)</a> <a href="#ref-for-idl-USVString⑤">(5)</a> <a href="#ref-for-idl-USVString⑥">(6)</a> <a href="#ref-for-idl-USVString⑦">(7)</a> <a href="#ref-for-idl-USVString⑧">(8)</a> <a href="#ref-for-idl-USVString⑨">(9)</a> <a href="#ref-for-idl-USVString①⓪">(10)</a> <a href="#ref-for-idl-USVString①①">(11)</a> <a href="#ref-for-idl-USVString①②">(12)</a> <a href="#ref-for-idl-USVString①③">(13)</a> <a href="#ref-for-idl-USVString①④">(14)</a> <a href="#ref-for-idl-USVString①⑤">(15)</a> <a href="#ref-for-idl-USVString①⑥">(16)</a> <a href="#ref-for-idl-USVString①⑦">(17)</a> <a href="#ref-for-idl-USVString①⑧">(18)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-boolean">
   <a href="https://heycam.github.io/webidl/#idl-boolean">https://heycam.github.io/webidl/#idl-boolean</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-boolean">3. The CookieStore Interface</a> <a href="#ref-for-idl-boolean①">(2)</a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[DOM]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-event" style="color:initial">Event</span>
     <li><span class="dfn-paneled" id="term-for-dictdef-eventinit" style="color:initial">EventInit</span>
     <li><span class="dfn-paneled" id="term-for-eventtarget" style="color:initial">EventTarget</span>
     <li><span class="dfn-paneled" id="term-for-dom-event-bubbles" style="color:initial">bubbles</span>
     <li><span class="dfn-paneled" id="term-for-dom-event-cancelable" style="color:initial">cancelable</span>
     <li><span class="dfn-paneled" id="term-for-context-object" style="color:initial">context object</span>
     <li><span class="dfn-paneled" id="term-for-concept-event-create" style="color:initial">creating an event</span>
     <li><span class="dfn-paneled" id="term-for-concept-event-dispatch" style="color:initial">dispatch</span>
     <li><span class="dfn-paneled" id="term-for-concept-document" style="color:initial">document</span>
     <li><span class="dfn-paneled" id="term-for-dom-event-type" style="color:initial">type</span>
    </ul>
   <li>
    <a data-link-type="biblio">[ecma262]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-sec-promise-objects" style="color:initial">promise</span>
     <li><span class="dfn-paneled" id="term-for-sec-time-values-and-time-range" style="color:initial">time values</span>
    </ul>
   <li>
    <a data-link-type="biblio">[ENCODING]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-utf-8-decode-without-bom" style="color:initial">utf-8 decode without bom</span>
     <li><span class="dfn-paneled" id="term-for-utf-8-encode" style="color:initial">utf-8 encode</span>
    </ul>
   <li>
    <a data-link-type="biblio">[FETCH]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-concept-fetch" style="color:initial">fetch</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-window" style="color:initial">window</span>
    </ul>
   <li>
    <a data-link-type="biblio">[HTML]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-eventhandler" style="color:initial">EventHandler</span>
     <li><span class="dfn-paneled" id="term-for-window" style="color:initial">Window</span>
     <li><span class="dfn-paneled" id="term-for-api-base-url" style="color:initial">api base url</span>
     <li><span class="dfn-paneled" id="term-for-dom-document-cookie" style="color:initial">cookie</span>
     <li><span class="dfn-paneled" id="term-for-concept-environment-creation-url" style="color:initial">creation url</span>
     <li><span class="dfn-paneled" id="term-for-current-global-object" style="color:initial">current global object</span>
     <li><span class="dfn-paneled" id="term-for-current-settings-object" style="color:initial">current settings object</span>
     <li><span class="dfn-paneled" id="term-for-dom-document-domain" style="color:initial">domain</span>
     <li><span class="dfn-paneled" id="term-for-concept-settings-object-global" style="color:initial">global object</span>
     <li><span class="dfn-paneled" id="term-for-in-parallel" style="color:initial">in parallel</span>
     <li><span class="dfn-paneled" id="term-for-concept-origin-opaque" style="color:initial">opaque origin</span>
     <li><span class="dfn-paneled" id="term-for-concept-origin" style="color:initial">origin</span>
     <li><span class="dfn-paneled" id="term-for-queue-a-task" style="color:initial">queue a task</span>
     <li><span class="dfn-paneled" id="term-for-relevant-settings-object" style="color:initial">relevant settings object</span>
     <li><span class="dfn-paneled" id="term-for-dom-history-replacestate" style="color:initial">replaceState(data, title)</span>
     <li><span class="dfn-paneled" id="term-for-responsible-event-loop" style="color:initial">responsible event loop</span>
     <li><span class="dfn-paneled" id="term-for-same-origin" style="color:initial">same origin</span>
    </ul>
   <li>
    <a data-link-type="biblio">[INFRA]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-set-append" style="color:initial">append <small>(for set)</small></span>
     <li><span class="dfn-paneled" id="term-for-iteration-break" style="color:initial">break</span>
     <li><span class="dfn-paneled" id="term-for-byte-sequence" style="color:initial">byte sequence</span>
     <li><span class="dfn-paneled" id="term-for-code-point" style="color:initial">code point</span>
     <li><span class="dfn-paneled" id="term-for-list-contain" style="color:initial">contain</span>
     <li><span class="dfn-paneled" id="term-for-iteration-continue" style="color:initial">continue</span>
     <li><span class="dfn-paneled" id="term-for-list-iterate" style="color:initial">for each</span>
     <li><span class="dfn-paneled" id="term-for-list-is-empty" style="color:initial">is empty</span>
     <li><span class="dfn-paneled" id="term-for-string-length" style="color:initial">length</span>
     <li><span class="dfn-paneled" id="term-for-list" style="color:initial">list</span>
     <li><span class="dfn-paneled" id="term-for-ordered-set" style="color:initial">set</span>
     <li><span class="dfn-paneled" id="term-for-tuple" style="color:initial">tuple</span>
    </ul>
   <li>
    <a data-link-type="biblio">[promises-guide]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-a-new-promise" style="color:initial">a new promise</span>
     <li><span class="dfn-paneled" id="term-for-a-promise-rejected-with" style="color:initial">a promise rejected with</span>
     <li><span class="dfn-paneled" id="term-for-reject-promise" style="color:initial">reject</span>
    </ul>
   <li>
    <a data-link-type="biblio">[Service-Workers]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-extendableevent" style="color:initial">ExtendableEvent</span>
     <li><span class="dfn-paneled" id="term-for-dictdef-extendableeventinit" style="color:initial">ExtendableEventInit</span>
     <li><span class="dfn-paneled" id="term-for-serviceworkerglobalscope" style="color:initial">ServiceWorkerGlobalScope</span>
     <li><span class="dfn-paneled" id="term-for-dfn-containing-service-worker-registration" style="color:initial">containing service worker registration</span>
     <li><span class="dfn-paneled" id="term-for-fire-functional-event" style="color:initial">fire a functional event</span>
     <li><span class="dfn-paneled" id="term-for-dfn-scope-url" style="color:initial">scope url</span>
     <li><span class="dfn-paneled" id="term-for-dfn-service-worker" style="color:initial">service worker</span>
     <li><span class="dfn-paneled" id="term-for-dfn-service-worker-registration" style="color:initial">service worker registration</span>
     <li><span class="dfn-paneled" id="term-for-dfn-state" style="color:initial">state</span>
    </ul>
   <li>
    <a data-link-type="biblio">[URL]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-concept-basic-url-parser" style="color:initial">basic url parser</span>
     <li><span class="dfn-paneled" id="term-for-concept-url-equals" style="color:initial">equal</span>
     <li><span class="dfn-paneled" id="term-for-concept-url-host" style="color:initial">host</span>
     <li><span class="dfn-paneled" id="term-for-concept-url-origin" style="color:initial">origin</span>
    </ul>
   <li>
    <a data-link-type="biblio">[WebIDL]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-idl-DOMException" style="color:initial">DOMException</span>
     <li><span class="dfn-paneled" id="term-for-idl-DOMString" style="color:initial">DOMString</span>
     <li><span class="dfn-paneled" id="term-for-DOMTimeStamp" style="color:initial">DOMTimeStamp</span>
     <li><span class="dfn-paneled" id="term-for-Exposed" style="color:initial">Exposed</span>
     <li><span class="dfn-paneled" id="term-for-Replaceable" style="color:initial">Replaceable</span>
     <li><span class="dfn-paneled" id="term-for-SameObject" style="color:initial">SameObject</span>
     <li><span class="dfn-paneled" id="term-for-SecureContext" style="color:initial">SecureContext</span>
     <li><span class="dfn-paneled" id="term-for-securityerror" style="color:initial">SecurityError</span>
     <li><span class="dfn-paneled" id="term-for-exceptiondef-typeerror" style="color:initial">TypeError</span>
     <li><span class="dfn-paneled" id="term-for-idl-USVString" style="color:initial">USVString</span>
     <li><span class="dfn-paneled" id="term-for-idl-boolean" style="color:initial">boolean</span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-dom">[DOM]
   <dd>Anne van Kesteren. <a href="https://dom.spec.whatwg.org/">DOM Standard</a>. Living Standard. URL: <a href="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a>
   <dt id="biblio-encoding">[ENCODING]
   <dd>Anne van Kesteren. <a href="https://encoding.spec.whatwg.org/">Encoding Standard</a>. Living Standard. URL: <a href="https://encoding.spec.whatwg.org/">https://encoding.spec.whatwg.org/</a>
   <dt id="biblio-fetch">[FETCH]
   <dd>Anne van Kesteren. <a href="https://fetch.spec.whatwg.org/">Fetch Standard</a>. Living Standard. URL: <a href="https://fetch.spec.whatwg.org/">https://fetch.spec.whatwg.org/</a>
   <dt id="biblio-html">[HTML]
   <dd>Anne van Kesteren; et al. <a href="https://html.spec.whatwg.org/multipage/">HTML Standard</a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a>
   <dt id="biblio-infra">[INFRA]
   <dd>Anne van Kesteren; Domenic Denicola. <a href="https://infra.spec.whatwg.org/">Infra Standard</a>. Living Standard. URL: <a href="https://infra.spec.whatwg.org/">https://infra.spec.whatwg.org/</a>
   <dt id="biblio-promises-guide">[PROMISES-GUIDE]
   <dd>Domenic Denicola. <a href="https://www.w3.org/2001/tag/doc/promises-guide">Writing Promise-Using Specifications</a>. 9 November 2018. TAG Finding. URL: <a href="https://www.w3.org/2001/tag/doc/promises-guide">https://www.w3.org/2001/tag/doc/promises-guide</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
   <dt id="biblio-rfc6265bis">[RFC6265bis]
   <dd>A. Barth; M. West. <a href="https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03">Cookies: HTTP State Management Mechanism</a>. Internet-Draft. URL: <a href="https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03">https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03</a>
   <dt id="biblio-service-workers">[Service-Workers]
   <dd>Alex Russell; et al. <a href="https://www.w3.org/TR/service-workers-1/">Service Workers 1</a>. 2 November 2017. WD. URL: <a href="https://www.w3.org/TR/service-workers-1/">https://www.w3.org/TR/service-workers-1/</a>
   <dt id="biblio-url">[URL]
   <dd>Anne van Kesteren. <a href="https://url.spec.whatwg.org/">URL Standard</a>. Living Standard. URL: <a href="https://url.spec.whatwg.org/">https://url.spec.whatwg.org/</a>
   <dt id="biblio-webidl">[WebIDL]
   <dd>Boris Zbarsky. <a href="https://heycam.github.io/webidl/">Web IDL</a>. 15 December 2016. ED. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a>
  </dl>
  <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
  <dl>
   <dt id="biblio-ecmascript">[ECMAScript]
   <dd><a href="https://tc39.github.io/ecma262/">ECMAScript Language Specification</a>. URL: <a href="https://tc39.github.io/ecma262/">https://tc39.github.io/ecma262/</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑥"><c- g>Exposed</c-></a>=(<c- n>ServiceWorker</c->,<c- n>Window</c->),
 <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext③"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a href="#cookiestore"><code><c- g>CookieStore</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget①"><c- n>EventTarget</c-></a> {
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-cookielistitem" id="ref-for-dictdef-cookielistitem⑤"><c- n>CookieListItem</c-></a>?> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-get" id="ref-for-dom-cookiestore-get②"><c- g>get</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①⑨"><c- b>USVString</c-></a> <a href="#dom-cookiestore-get-name-name"><code><c- g>name</c-></code></a>);
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-cookielistitem" id="ref-for-dictdef-cookielistitem①①"><c- n>CookieListItem</c-></a>?> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-get-options" id="ref-for-dom-cookiestore-get-options④①"><c- g>get</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cookiestoregetoptions" id="ref-for-dictdef-cookiestoregetoptions⑤"><c- n>CookieStoreGetOptions</c-></a> <a href="#dom-cookiestore-get-options-options"><code><c- g>options</c-></code></a> = {});

  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist①⓪"><c- n>CookieList</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-getall" id="ref-for-dom-cookiestore-getall②"><c- g>getAll</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString②①"><c- b>USVString</c-></a> <a href="#dom-cookiestore-getall-name-name"><code><c- g>name</c-></code></a>);
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist①①"><c- n>CookieList</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-getall-options" id="ref-for-dom-cookiestore-getall-options④①"><c- g>getAll</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cookiestoregetoptions" id="ref-for-dictdef-cookiestoregetoptions①①"><c- n>CookieStoreGetOptions</c-></a> <a href="#dom-cookiestore-getall-options-options"><code><c- g>options</c-></code></a> = {});

  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-set" id="ref-for-dom-cookiestore-set②①"><c- g>set</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString③①"><c- b>USVString</c-></a> <a href="#dom-cookiestore-set-name-value-options-name"><code><c- g>name</c-></code></a>, <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString④①"><c- b>USVString</c-></a> <a href="#dom-cookiestore-set-name-value-options-value"><code><c- g>value</c-></code></a>,
                    <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cookiestoresetoptions" id="ref-for-dictdef-cookiestoresetoptions②"><c- n>CookieStoreSetOptions</c-></a> <a href="#dom-cookiestore-set-name-value-options-options"><code><c- g>options</c-></code></a> = {});
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-set-options" id="ref-for-dom-cookiestore-set-options②"><c- g>set</c-></a>(<a class="n" data-link-type="idl-name" href="#dictdef-cookiestoresetextraoptions" id="ref-for-dictdef-cookiestoresetextraoptions①"><c- n>CookieStoreSetExtraOptions</c-></a> <a href="#dom-cookiestore-set-options-options"><code><c- g>options</c-></code></a>);

  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-delete" id="ref-for-dom-cookiestore-delete①①"><c- g>delete</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑤①"><c- b>USVString</c-></a> <a href="#dom-cookiestore-delete-name-name"><code><c- g>name</c-></code></a>);
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-delete-options" id="ref-for-dom-cookiestore-delete-options②"><c- g>delete</c-></a>(<a class="n" data-link-type="idl-name" href="#dictdef-cookiestoredeleteoptions" id="ref-for-dictdef-cookiestoredeleteoptions①"><c- n>CookieStoreDeleteOptions</c-></a> <a href="#dom-cookiestore-delete-options-options"><code><c- g>options</c-></code></a>);

  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①①"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-subscribetochanges" id="ref-for-dom-cookiestore-subscribetochanges①①"><c- g>subscribeToChanges</c-></a>(<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-cookiestoregetoptions" id="ref-for-dictdef-cookiestoregetoptions②①"><c- n>CookieStoreGetOptions</c-></a>> <a href="#dom-cookiestore-subscribetochanges-subscriptions-subscriptions"><code><c- g>subscriptions</c-></code></a>);

  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②①"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
  <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-cookiestoregetoptions" id="ref-for-dictdef-cookiestoregetoptions③①"><c- n>CookieStoreGetOptions</c-></a>>> <a class="idl-code" data-link-type="method" href="#dom-cookiestore-getchangesubscriptions" id="ref-for-dom-cookiestore-getchangesubscriptions①①"><c- g>getChangeSubscriptions</c-></a>();

  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed③①"><c- g>Exposed</c-></a>=<c- n>Window</c->]
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler②"><c- n>EventHandler</c-></a> <a data-type="EventHandler" href="#dom-cookiestore-onchange"><code><c- g>onchange</c-></code></a>;
};

<c- b>enum</c-> <a href="#enumdef-cookiematchtype"><code><c- g>CookieMatchType</c-></code></a> {
  <a href="#dom-cookiematchtype-equals"><code><c- s>"equals"</c-></code></a>,
  <a href="#dom-cookiematchtype-starts-with"><code><c- s>"starts-with"</c-></code></a>
};

<c- b>dictionary</c-> <a href="#dictdef-cookiestoregetoptions"><code><c- g>CookieStoreGetOptions</c-></code></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑥①"><c- b>USVString</c-></a> <a data-type="USVString " href="#dom-cookiestoregetoptions-name"><code><c- g>name</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑦①"><c- b>USVString</c-></a> <a data-type="USVString " href="#dom-cookiestoregetoptions-url"><code><c- g>url</c-></code></a>;
  <a class="n" data-link-type="idl-name" href="#enumdef-cookiematchtype" id="ref-for-enumdef-cookiematchtype①"><c- n>CookieMatchType</c-></a> <a data-default="&quot;equals&quot;" data-type="CookieMatchType " href="#dom-cookiestoregetoptions-matchtype"><code><c- g>matchType</c-></code></a> = "equals";
};

<c- b>enum</c-> <a href="#enumdef-cookiesamesite"><code><c- g>CookieSameSite</c-></code></a> {
  <a href="#dom-cookiesamesite-strict"><code><c- s>"strict"</c-></code></a>,
  <a href="#dom-cookiesamesite-lax"><code><c- s>"lax"</c-></code></a>,
  <a href="#dom-cookiesamesite-none"><code><c- s>"none"</c-></code></a>
};

<c- b>dictionary</c-> <a href="#dictdef-cookiestoresetoptions"><code><c- g>CookieStoreSetOptions</c-></code></a> {
  <a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#DOMTimeStamp" id="ref-for-DOMTimeStamp③"><c- n>DOMTimeStamp</c-></a>? <a data-default="null" data-type="DOMTimeStamp? " href="#dom-cookiestoresetoptions-expires"><code><c- g>expires</c-></code></a> = <c- b>null</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑧①"><c- b>USVString</c-></a>? <a data-default="null" data-type="USVString? " href="#dom-cookiestoresetoptions-domain"><code><c- g>domain</c-></code></a> = <c- b>null</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑨①"><c- b>USVString</c-></a> <a data-default="&quot;/&quot;" data-type="USVString " href="#dom-cookiestoresetoptions-path"><code><c- g>path</c-></code></a> = "/";
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean②"><c- b>boolean</c-></a> <a data-default="true" data-type="boolean " href="#dom-cookiestoresetoptions-secure"><code><c- g>secure</c-></code></a> = <c- b>true</c->;
  <a class="n" data-link-type="idl-name" href="#enumdef-cookiesamesite" id="ref-for-enumdef-cookiesamesite②"><c- n>CookieSameSite</c-></a> <a data-default="&quot;strict&quot;" data-type="CookieSameSite " href="#dom-cookiestoresetoptions-samesite"><code><c- g>sameSite</c-></code></a> = "strict";
};

<c- b>dictionary</c-> <a href="#dictdef-cookiestoresetextraoptions"><code><c- g>CookieStoreSetExtraOptions</c-></code></a> : <a class="n" data-link-type="idl-name" href="#dictdef-cookiestoresetoptions" id="ref-for-dictdef-cookiestoresetoptions①①"><c- n>CookieStoreSetOptions</c-></a> {
  <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①⓪①"><c- b>USVString</c-></a> <a data-type="USVString " href="#dom-cookiestoresetextraoptions-name"><code><c- g>name</c-></code></a>;
  <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①①①"><c- b>USVString</c-></a> <a data-type="USVString " href="#dom-cookiestoresetextraoptions-value"><code><c- g>value</c-></code></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-cookiestoredeleteoptions"><code><c- g>CookieStoreDeleteOptions</c-></code></a> {
  <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①②①"><c- b>USVString</c-></a> <a data-type="USVString " href="#dom-cookiestoredeleteoptions-name"><code><c- g>name</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①③①"><c- b>USVString</c-></a>? <a data-default="null" data-type="USVString? " href="#dom-cookiestoredeleteoptions-domain"><code><c- g>domain</c-></code></a> = <c- b>null</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①④①"><c- b>USVString</c-></a> <a data-default="&quot;/&quot;" data-type="USVString " href="#dom-cookiestoredeleteoptions-path"><code><c- g>path</c-></code></a> = "/";
};

<c- b>dictionary</c-> <a href="#dictdef-cookielistitem"><code><c- g>CookieListItem</c-></code></a> {
  <c- b>required</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①⑤①"><c- b>USVString</c-></a> <a data-type="USVString " href="#dom-cookielistitem-name"><code><c- g>name</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①⑥①"><c- b>USVString</c-></a> <a data-type="USVString " href="#dom-cookielistitem-value"><code><c- g>value</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①⑦①"><c- b>USVString</c-></a>? <a data-default="null" data-type="USVString? " href="#dom-cookielistitem-domain"><code><c- g>domain</c-></code></a> = <c- b>null</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①⑧①"><c- b>USVString</c-></a> <a data-default="&quot;/&quot;" data-type="USVString " href="#dom-cookielistitem-path"><code><c- g>path</c-></code></a> = "/";
  <a class="n" data-link-type="idl-name" href="https://heycam.github.io/webidl/#DOMTimeStamp" id="ref-for-DOMTimeStamp①①"><c- n>DOMTimeStamp</c-></a>? <a data-default="null" data-type="DOMTimeStamp? " href="#dom-cookielistitem-expires"><code><c- g>expires</c-></code></a> = <c- b>null</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①①"><c- b>boolean</c-></a> <a data-default="true" data-type="boolean " href="#dom-cookielistitem-secure"><code><c- g>secure</c-></code></a> = <c- b>true</c->;
  <a class="n" data-link-type="idl-name" href="#enumdef-cookiesamesite" id="ref-for-enumdef-cookiesamesite①①"><c- n>CookieSameSite</c-></a> <a data-default="&quot;strict&quot;" data-type="CookieSameSite " href="#dom-cookielistitem-samesite"><code><c- g>sameSite</c-></code></a> = "strict";
};

<c- b>typedef</c-> <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#dictdef-cookielistitem" id="ref-for-dictdef-cookielistitem②①"><c- n>CookieListItem</c-></a>> <a href="#typedefdef-cookielist"><code><c- g>CookieList</c-></code></a>;

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed④①"><c- g>Exposed</c-></a>=<c- n>Window</c->,
 <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①①"><c- g>SecureContext</c-></a>]
<c- b>interface</c-> <a href="#cookiechangeevent"><code><c- g>CookieChangeEvent</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event" id="ref-for-event①"><c- n>Event</c-></a> {
  <a href="#dom-cookiechangeevent-cookiechangeevent"><code><c- g>constructor</c-></code></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString②"><c- b>DOMString</c-></a> <a href="#dom-cookiechangeevent-cookiechangeevent-type-eventinitdict-type"><code><c- g>type</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cookiechangeeventinit" id="ref-for-dictdef-cookiechangeeventinit①"><c- n>CookieChangeEventInit</c-></a> <a href="#dom-cookiechangeevent-cookiechangeevent-type-eventinitdict-eventinitdict"><code><c- g>eventInitDict</c-></code></a> = {});
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist②①"><c- n>CookieList</c-></a> <a data-readonly data-type="CookieList" href="#dom-cookiechangeevent-changed"><code><c- g>changed</c-></code></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist③①"><c- n>CookieList</c-></a> <a data-readonly data-type="CookieList" href="#dom-cookiechangeevent-deleted"><code><c- g>deleted</c-></code></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-cookiechangeeventinit"><code><c- g>CookieChangeEventInit</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit" id="ref-for-dictdef-eventinit①"><c- n>EventInit</c-></a> {
  <a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist④①"><c- n>CookieList</c-></a> <a data-type="CookieList " href="#dom-cookiechangeeventinit-changed"><code><c- g>changed</c-></code></a>;
  <a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist⑤①"><c- n>CookieList</c-></a> <a data-type="CookieList " href="#dom-cookiechangeeventinit-deleted"><code><c- g>deleted</c-></code></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑤①"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->
] <c- b>interface</c-> <a href="#extendablecookiechangeevent"><code><c- g>ExtendableCookieChangeEvent</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://w3c.github.io/ServiceWorker/#extendableevent" id="ref-for-extendableevent①"><c- n>ExtendableEvent</c-></a> {
  <a href="#dom-extendablecookiechangeevent-extendablecookiechangeevent"><code><c- g>constructor</c-></code></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①①"><c- b>DOMString</c-></a> <a href="#dom-extendablecookiechangeevent-extendablecookiechangeevent-type-eventinitdict-type"><code><c- g>type</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-extendablecookiechangeeventinit" id="ref-for-dictdef-extendablecookiechangeeventinit①"><c- n>ExtendableCookieChangeEventInit</c-></a> <a href="#dom-extendablecookiechangeevent-extendablecookiechangeevent-type-eventinitdict-eventinitdict"><code><c- g>eventInitDict</c-></code></a> = {});
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist⑥①"><c- n>CookieList</c-></a> <a data-readonly data-type="CookieList" href="#dom-extendablecookiechangeevent-changed"><code><c- g>changed</c-></code></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist⑦①"><c- n>CookieList</c-></a> <a data-readonly data-type="CookieList" href="#dom-extendablecookiechangeevent-deleted"><code><c- g>deleted</c-></code></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-extendablecookiechangeeventinit"><code><c- g>ExtendableCookieChangeEventInit</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://w3c.github.io/ServiceWorker/#dictdef-extendableeventinit" id="ref-for-dictdef-extendableeventinit①"><c- n>ExtendableEventInit</c-></a> {
  <a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist⑧①"><c- n>CookieList</c-></a> <a data-type="CookieList " href="#dom-extendablecookiechangeeventinit-changed"><code><c- g>changed</c-></code></a>;
  <a class="n" data-link-type="idl-name" href="#typedefdef-cookielist" id="ref-for-typedefdef-cookielist⑨①"><c- n>CookieList</c-></a> <a data-type="CookieList " href="#dom-extendablecookiechangeeventinit-deleted"><code><c- g>deleted</c-></code></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext②①"><c- g>SecureContext</c-></a>]
<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window⑤①"><c- g>Window</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Replaceable" id="ref-for-Replaceable②"><c- g>Replaceable</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject②"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#cookiestore" id="ref-for-cookiestore④①"><c- n>CookieStore</c-></a> <a data-readonly data-type="CookieStore" href="#dom-window-cookiestore"><code><c- g>cookieStore</c-></code></a>;
};

<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope" id="ref-for-serviceworkerglobalscope③①"><c- g>ServiceWorkerGlobalScope</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Replaceable" id="ref-for-Replaceable①①"><c- g>Replaceable</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject①①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#cookiestore" id="ref-for-cookiestore⑥①"><c- n>CookieStore</c-></a> <a data-readonly data-type="CookieStore" href="#dom-serviceworkerglobalscope-cookiestore"><code><c- g>cookieStore</c-></code></a>;

  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler①①"><c- n>EventHandler</c-></a> <a data-type="EventHandler" href="#dom-serviceworkerglobalscope-oncookiechange"><code><c- g>oncookiechange</c-></code></a>;
};

</pre>
  <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
  <div style="counter-reset:issue">
   <div class="issue"> How about when "the current session is over" for non-persistent cookies?<a href="#issue-30ac9b7d"> ↵ </a></div>
  </div>
  <aside class="dfn-panel" data-for="script-visible">
   <b><a href="#script-visible">#script-visible</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-script-visible">1.2. Summary</a> <a href="#ref-for-script-visible①">(2)</a>
    <li><a href="#ref-for-script-visible②">3.1. The get() method</a>
    <li><a href="#ref-for-script-visible③">3.2. The getAll() method</a>
    <li><a href="#ref-for-script-visible④">4.1. The CookieChangeEvent interface</a>
    <li><a href="#ref-for-script-visible⑤">4.2. The ExtendableCookieChangeEvent interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie">
   <b><a href="#cookie">#cookie</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie">2.1. Cookie</a>
    <li><a href="#ref-for-cookie①">2.2. Cookie Store</a> <a href="#ref-for-cookie②">(2)</a> <a href="#ref-for-cookie③">(3)</a>
    <li><a href="#ref-for-cookie④">6. Algorithms</a>
    <li><a href="#ref-for-cookie⑤">6.4. Process Changes</a> <a href="#ref-for-cookie⑥">(2)</a> <a href="#ref-for-cookie⑦">(3)</a> <a href="#ref-for-cookie⑧">(4)</a> <a href="#ref-for-cookie⑨">(5)</a> <a href="#ref-for-cookie①⓪">(6)</a> <a href="#ref-for-cookie①①">(7)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-name">
   <b><a href="#cookie-name">#cookie-name</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-name">1.3. Querying Cookies</a>
    <li><a href="#ref-for-cookie-name①">6.1. Query Cookies</a> <a href="#ref-for-cookie-name②">(2)</a>
    <li><a href="#ref-for-cookie-name③">6.4. Process Changes</a> <a href="#ref-for-cookie-name④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-value">
   <b><a href="#cookie-value">#cookie-value</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-value">1.3. Querying Cookies</a>
    <li><a href="#ref-for-cookie-value①">6.1. Query Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-expiry-time">
   <b><a href="#cookie-expiry-time">#cookie-expiry-time</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-expiry-time">6.1. Query Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-domain">
   <b><a href="#cookie-domain">#cookie-domain</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-domain">6.1. Query Cookies</a>
    <li><a href="#ref-for-cookie-domain①">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-path">
   <b><a href="#cookie-path">#cookie-path</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-path">6.1. Query Cookies</a>
    <li><a href="#ref-for-cookie-path①">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-creation-time">
   <b><a href="#cookie-creation-time">#cookie-creation-time</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-creation-time">6.1. Query Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-last-access-time">
   <b><a href="#cookie-last-access-time">#cookie-last-access-time</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-last-access-time">6.1. Query Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-persistent-flag">
   <b><a href="#cookie-persistent-flag">#cookie-persistent-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-persistent-flag">6.1. Query Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-host-only-flag">
   <b><a href="#cookie-host-only-flag">#cookie-host-only-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-host-only-flag">6.1. Query Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-secure-only-flag">
   <b><a href="#cookie-secure-only-flag">#cookie-secure-only-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-secure-only-flag">6.1. Query Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-http-only-flag">
   <b><a href="#cookie-http-only-flag">#cookie-http-only-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-http-only-flag">6.1. Query Cookies</a> <a href="#ref-for-cookie-http-only-flag①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-same-site-flag">
   <b><a href="#cookie-same-site-flag">#cookie-same-site-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-same-site-flag">6.1. Query Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-store">
   <b><a href="#cookie-store">#cookie-store</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-store">2.2. Cookie Store</a> <a href="#ref-for-cookie-store①">(2)</a> <a href="#ref-for-cookie-store②">(3)</a> <a href="#ref-for-cookie-store③">(4)</a>
    <li><a href="#ref-for-cookie-store④">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-change-subscription-list">
   <b><a href="#cookie-change-subscription-list">#cookie-change-subscription-list</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-change-subscription-list">3.5. The subscribeToChanges() method</a>
    <li><a href="#ref-for-cookie-change-subscription-list①">3.6. The getChangeSubscriptions() method</a>
    <li><a href="#ref-for-cookie-change-subscription-list②">4.2. The ExtendableCookieChangeEvent interface</a>
    <li><a href="#ref-for-cookie-change-subscription-list③">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-change-subscription">
   <b><a href="#cookie-change-subscription">#cookie-change-subscription</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-change-subscription">2.3. Extensions to Service Worker</a>
    <li><a href="#ref-for-cookie-change-subscription①">3.5. The subscribeToChanges() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-change-subscription-name">
   <b><a href="#cookie-change-subscription-name">#cookie-change-subscription-name</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-change-subscription-name">3.6. The getChangeSubscriptions() method</a>
    <li><a href="#ref-for-cookie-change-subscription-name①">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-change-subscription-url">
   <b><a href="#cookie-change-subscription-url">#cookie-change-subscription-url</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-change-subscription-url">3.6. The getChangeSubscriptions() method</a>
    <li><a href="#ref-for-cookie-change-subscription-url①">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-change-subscription-matchtype">
   <b><a href="#cookie-change-subscription-matchtype">#cookie-change-subscription-matchtype</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-change-subscription-matchtype">3.6. The getChangeSubscriptions() method</a>
    <li><a href="#ref-for-cookie-change-subscription-matchtype①">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookiestore">
   <b><a href="#cookiestore">#cookiestore</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookiestore">1.3. Querying Cookies</a>
    <li><a href="#ref-for-cookiestore①">3. The CookieStore Interface</a>
    <li><a href="#ref-for-cookiestore②">4.1. The CookieChangeEvent interface</a>
    <li><a href="#ref-for-cookiestore③">5. Global Interfaces</a>
    <li><a href="#ref-for-cookiestore④">5.1. The Window interface</a> <a href="#ref-for-cookiestore⑤">(2)</a>
    <li><a href="#ref-for-cookiestore⑥">5.2. The ServiceWorkerGlobalScope interface</a> <a href="#ref-for-cookiestore⑦">(2)</a>
    <li><a href="#ref-for-cookiestore⑧">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="enumdef-cookiematchtype">
   <b><a href="#enumdef-cookiematchtype">#enumdef-cookiematchtype</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-enumdef-cookiematchtype">3. The CookieStore Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiematchtype-equals">
   <b><a href="#dom-cookiematchtype-equals">#dom-cookiematchtype-equals</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiematchtype-equals">6.1. Query Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiematchtype-starts-with">
   <b><a href="#dom-cookiematchtype-starts-with">#dom-cookiematchtype-starts-with</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiematchtype-starts-with">6.1. Query Cookies</a> <a href="#ref-for-dom-cookiematchtype-starts-with①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-cookiestoregetoptions">
   <b><a href="#dictdef-cookiestoregetoptions">#dictdef-cookiestoregetoptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-cookiestoregetoptions">3. The CookieStore Interface</a> <a href="#ref-for-dictdef-cookiestoregetoptions①">(2)</a> <a href="#ref-for-dictdef-cookiestoregetoptions②">(3)</a> <a href="#ref-for-dictdef-cookiestoregetoptions③">(4)</a>
    <li><a href="#ref-for-dictdef-cookiestoregetoptions④">3.6. The getChangeSubscriptions() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestoregetoptions-name">
   <b><a href="#dom-cookiestoregetoptions-name">#dom-cookiestoregetoptions-name</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestoregetoptions-name">3.1. The get() method</a>
    <li><a href="#ref-for-dom-cookiestoregetoptions-name①">3.2. The getAll() method</a>
    <li><a href="#ref-for-dom-cookiestoregetoptions-name②">3.5. The subscribeToChanges() method</a>
    <li><a href="#ref-for-dom-cookiestoregetoptions-name③">3.6. The getChangeSubscriptions() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestoregetoptions-url">
   <b><a href="#dom-cookiestoregetoptions-url">#dom-cookiestoregetoptions-url</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestoregetoptions-url">1.3. Querying Cookies</a>
    <li><a href="#ref-for-dom-cookiestoregetoptions-url①">3.1. The get() method</a> <a href="#ref-for-dom-cookiestoregetoptions-url②">(2)</a>
    <li><a href="#ref-for-dom-cookiestoregetoptions-url③">3.2. The getAll() method</a> <a href="#ref-for-dom-cookiestoregetoptions-url④">(2)</a>
    <li><a href="#ref-for-dom-cookiestoregetoptions-url⑤">3.5. The subscribeToChanges() method</a>
    <li><a href="#ref-for-dom-cookiestoregetoptions-url⑥">3.6. The getChangeSubscriptions() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestoregetoptions-matchtype">
   <b><a href="#dom-cookiestoregetoptions-matchtype">#dom-cookiestoregetoptions-matchtype</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestoregetoptions-matchtype">3.1. The get() method</a>
    <li><a href="#ref-for-dom-cookiestoregetoptions-matchtype①">3.2. The getAll() method</a>
    <li><a href="#ref-for-dom-cookiestoregetoptions-matchtype②">3.5. The subscribeToChanges() method</a>
    <li><a href="#ref-for-dom-cookiestoregetoptions-matchtype③">3.6. The getChangeSubscriptions() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="enumdef-cookiesamesite">
   <b><a href="#enumdef-cookiesamesite">#enumdef-cookiesamesite</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-enumdef-cookiesamesite">3. The CookieStore Interface</a> <a href="#ref-for-enumdef-cookiesamesite①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiesamesite-strict">
   <b><a href="#dom-cookiesamesite-strict">#dom-cookiesamesite-strict</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiesamesite-strict">3.4. The delete() method</a>
    <li><a href="#ref-for-dom-cookiesamesite-strict①">6.1. Query Cookies</a>
    <li><a href="#ref-for-dom-cookiesamesite-strict②">6.2. Set a Cookie</a>
    <li><a href="#ref-for-dom-cookiesamesite-strict③">6.3. Delete a Cookie</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiesamesite-lax">
   <b><a href="#dom-cookiesamesite-lax">#dom-cookiesamesite-lax</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiesamesite-lax">6.1. Query Cookies</a>
    <li><a href="#ref-for-dom-cookiesamesite-lax①">6.2. Set a Cookie</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiesamesite-none">
   <b><a href="#dom-cookiesamesite-none">#dom-cookiesamesite-none</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiesamesite-none">6.1. Query Cookies</a>
    <li><a href="#ref-for-dom-cookiesamesite-none①">6.2. Set a Cookie</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-cookiestoresetoptions">
   <b><a href="#dictdef-cookiestoresetoptions">#dictdef-cookiestoresetoptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-cookiestoresetoptions">3. The CookieStore Interface</a> <a href="#ref-for-dictdef-cookiestoresetoptions①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestoresetoptions-expires">
   <b><a href="#dom-cookiestoresetoptions-expires">#dom-cookiestoresetoptions-expires</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestoresetoptions-expires">3.3. The set() method</a> <a href="#ref-for-dom-cookiestoresetoptions-expires①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestoresetoptions-domain">
   <b><a href="#dom-cookiestoresetoptions-domain">#dom-cookiestoresetoptions-domain</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestoresetoptions-domain">3.3. The set() method</a> <a href="#ref-for-dom-cookiestoresetoptions-domain①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestoresetoptions-path">
   <b><a href="#dom-cookiestoresetoptions-path">#dom-cookiestoresetoptions-path</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestoresetoptions-path">3.3. The set() method</a> <a href="#ref-for-dom-cookiestoresetoptions-path①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestoresetoptions-secure">
   <b><a href="#dom-cookiestoresetoptions-secure">#dom-cookiestoresetoptions-secure</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestoresetoptions-secure">3.3. The set() method</a> <a href="#ref-for-dom-cookiestoresetoptions-secure①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestoresetoptions-samesite">
   <b><a href="#dom-cookiestoresetoptions-samesite">#dom-cookiestoresetoptions-samesite</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestoresetoptions-samesite">3.3. The set() method</a> <a href="#ref-for-dom-cookiestoresetoptions-samesite①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-cookiestoresetextraoptions">
   <b><a href="#dictdef-cookiestoresetextraoptions">#dictdef-cookiestoresetextraoptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-cookiestoresetextraoptions">3. The CookieStore Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestoresetextraoptions-name">
   <b><a href="#dom-cookiestoresetextraoptions-name">#dom-cookiestoresetextraoptions-name</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestoresetextraoptions-name">3.3. The set() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestoresetextraoptions-value">
   <b><a href="#dom-cookiestoresetextraoptions-value">#dom-cookiestoresetextraoptions-value</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestoresetextraoptions-value">3.3. The set() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-cookiestoredeleteoptions">
   <b><a href="#dictdef-cookiestoredeleteoptions">#dictdef-cookiestoredeleteoptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-cookiestoredeleteoptions">3. The CookieStore Interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestoredeleteoptions-name">
   <b><a href="#dom-cookiestoredeleteoptions-name">#dom-cookiestoredeleteoptions-name</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestoredeleteoptions-name">3.4. The delete() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestoredeleteoptions-domain">
   <b><a href="#dom-cookiestoredeleteoptions-domain">#dom-cookiestoredeleteoptions-domain</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestoredeleteoptions-domain">3.4. The delete() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestoredeleteoptions-path">
   <b><a href="#dom-cookiestoredeleteoptions-path">#dom-cookiestoredeleteoptions-path</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestoredeleteoptions-path">3.4. The delete() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-cookielistitem">
   <b><a href="#dictdef-cookielistitem">#dictdef-cookielistitem</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-cookielistitem">3. The CookieStore Interface</a> <a href="#ref-for-dictdef-cookielistitem①">(2)</a> <a href="#ref-for-dictdef-cookielistitem②">(3)</a>
    <li><a href="#ref-for-dictdef-cookielistitem③">6.1. Query Cookies</a> <a href="#ref-for-dictdef-cookielistitem④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookielistitem-name">
   <b><a href="#dom-cookielistitem-name">#dom-cookielistitem-name</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookielistitem-name">6.1. Query Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookielistitem-value">
   <b><a href="#dom-cookielistitem-value">#dom-cookielistitem-value</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookielistitem-value">6.1. Query Cookies</a>
    <li><a href="#ref-for-dom-cookielistitem-value①">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookielistitem-domain">
   <b><a href="#dom-cookielistitem-domain">#dom-cookielistitem-domain</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookielistitem-domain">6.1. Query Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookielistitem-path">
   <b><a href="#dom-cookielistitem-path">#dom-cookielistitem-path</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookielistitem-path">6.1. Query Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookielistitem-expires">
   <b><a href="#dom-cookielistitem-expires">#dom-cookielistitem-expires</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookielistitem-expires">6.1. Query Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookielistitem-secure">
   <b><a href="#dom-cookielistitem-secure">#dom-cookielistitem-secure</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookielistitem-secure">6.1. Query Cookies</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookielistitem-samesite">
   <b><a href="#dom-cookielistitem-samesite">#dom-cookielistitem-samesite</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookielistitem-samesite">6.1. Query Cookies</a> <a href="#ref-for-dom-cookielistitem-samesite①">(2)</a> <a href="#ref-for-dom-cookielistitem-samesite②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="typedefdef-cookielist">
   <b><a href="#typedefdef-cookielist">#typedefdef-cookielist</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedefdef-cookielist">3. The CookieStore Interface</a> <a href="#ref-for-typedefdef-cookielist①">(2)</a>
    <li><a href="#ref-for-typedefdef-cookielist②">4.1. The CookieChangeEvent interface</a> <a href="#ref-for-typedefdef-cookielist③">(2)</a> <a href="#ref-for-typedefdef-cookielist④">(3)</a> <a href="#ref-for-typedefdef-cookielist⑤">(4)</a>
    <li><a href="#ref-for-typedefdef-cookielist⑥">4.2. The ExtendableCookieChangeEvent interface</a> <a href="#ref-for-typedefdef-cookielist⑦">(2)</a> <a href="#ref-for-typedefdef-cookielist⑧">(3)</a> <a href="#ref-for-typedefdef-cookielist⑨">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestore-get">
   <b><a href="#dom-cookiestore-get">#dom-cookiestore-get</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestore-get">3. The CookieStore Interface</a>
    <li><a href="#ref-for-dom-cookiestore-get①">3.1. The get() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestore-get-options">
   <b><a href="#dom-cookiestore-get-options">#dom-cookiestore-get-options</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestore-get-options">1.3. Querying Cookies</a> <a href="#ref-for-dom-cookiestore-get-options①">(2)</a> <a href="#ref-for-dom-cookiestore-get-options②">(3)</a>
    <li><a href="#ref-for-dom-cookiestore-get-options③">1.5. Monitoring Cookies</a>
    <li><a href="#ref-for-dom-cookiestore-get-options④">3. The CookieStore Interface</a>
    <li><a href="#ref-for-dom-cookiestore-get-options⑤">3.1. The get() method</a> <a href="#ref-for-dom-cookiestore-get-options⑥">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestore-getall">
   <b><a href="#dom-cookiestore-getall">#dom-cookiestore-getall</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestore-getall">3. The CookieStore Interface</a>
    <li><a href="#ref-for-dom-cookiestore-getall①">3.2. The getAll() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestore-getall-options">
   <b><a href="#dom-cookiestore-getall-options">#dom-cookiestore-getall-options</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestore-getall-options">1.3. Querying Cookies</a> <a href="#ref-for-dom-cookiestore-getall-options①">(2)</a> <a href="#ref-for-dom-cookiestore-getall-options②">(3)</a>
    <li><a href="#ref-for-dom-cookiestore-getall-options③">1.5. Monitoring Cookies</a>
    <li><a href="#ref-for-dom-cookiestore-getall-options④">3. The CookieStore Interface</a>
    <li><a href="#ref-for-dom-cookiestore-getall-options⑤">3.2. The getAll() method</a> <a href="#ref-for-dom-cookiestore-getall-options⑥">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestore-set">
   <b><a href="#dom-cookiestore-set">#dom-cookiestore-set</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestore-set">1.4. Modifying Cookies</a> <a href="#ref-for-dom-cookiestore-set①">(2)</a>
    <li><a href="#ref-for-dom-cookiestore-set②">3. The CookieStore Interface</a>
    <li><a href="#ref-for-dom-cookiestore-set③">3.3. The set() method</a> <a href="#ref-for-dom-cookiestore-set④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestore-set-options">
   <b><a href="#dom-cookiestore-set-options">#dom-cookiestore-set-options</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestore-set-options">3. The CookieStore Interface</a>
    <li><a href="#ref-for-dom-cookiestore-set-options①">3.3. The set() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestore-delete">
   <b><a href="#dom-cookiestore-delete">#dom-cookiestore-delete</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestore-delete">1.4. Modifying Cookies</a>
    <li><a href="#ref-for-dom-cookiestore-delete①">3. The CookieStore Interface</a>
    <li><a href="#ref-for-dom-cookiestore-delete②">3.4. The delete() method</a> <a href="#ref-for-dom-cookiestore-delete③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestore-delete-options">
   <b><a href="#dom-cookiestore-delete-options">#dom-cookiestore-delete-options</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestore-delete-options">3. The CookieStore Interface</a>
    <li><a href="#ref-for-dom-cookiestore-delete-options①">3.4. The delete() method</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestore-subscribetochanges">
   <b><a href="#dom-cookiestore-subscribetochanges">#dom-cookiestore-subscribetochanges</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestore-subscribetochanges">1.5. Monitoring Cookies</a>
    <li><a href="#ref-for-dom-cookiestore-subscribetochanges①">3. The CookieStore Interface</a>
    <li><a href="#ref-for-dom-cookiestore-subscribetochanges②">3.5. The subscribeToChanges() method</a> <a href="#ref-for-dom-cookiestore-subscribetochanges③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiestore-getchangesubscriptions">
   <b><a href="#dom-cookiestore-getchangesubscriptions">#dom-cookiestore-getchangesubscriptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiestore-getchangesubscriptions">1.5. Monitoring Cookies</a>
    <li><a href="#ref-for-dom-cookiestore-getchangesubscriptions①">3. The CookieStore Interface</a>
    <li><a href="#ref-for-dom-cookiestore-getchangesubscriptions②">3.6. The getChangeSubscriptions() method</a> <a href="#ref-for-dom-cookiestore-getchangesubscriptions③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookiechangeevent">
   <b><a href="#cookiechangeevent">#cookiechangeevent</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookiechangeevent">4.1. The CookieChangeEvent interface</a> <a href="#ref-for-cookiechangeevent①">(2)</a>
    <li><a href="#ref-for-cookiechangeevent②">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiechangeevent-changed">
   <b><a href="#dom-cookiechangeevent-changed">#dom-cookiechangeevent-changed</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiechangeevent-changed">4.1. The CookieChangeEvent interface</a>
    <li><a href="#ref-for-dom-cookiechangeevent-changed①">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cookiechangeevent-deleted">
   <b><a href="#dom-cookiechangeevent-deleted">#dom-cookiechangeevent-deleted</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cookiechangeevent-deleted">4.1. The CookieChangeEvent interface</a>
    <li><a href="#ref-for-dom-cookiechangeevent-deleted①">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-cookiechangeeventinit">
   <b><a href="#dictdef-cookiechangeeventinit">#dictdef-cookiechangeeventinit</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-cookiechangeeventinit">4.1. The CookieChangeEvent interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extendablecookiechangeevent">
   <b><a href="#extendablecookiechangeevent">#extendablecookiechangeevent</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extendablecookiechangeevent">4.2. The ExtendableCookieChangeEvent interface</a> <a href="#ref-for-extendablecookiechangeevent①">(2)</a>
    <li><a href="#ref-for-extendablecookiechangeevent②">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-extendablecookiechangeevent-changed">
   <b><a href="#dom-extendablecookiechangeevent-changed">#dom-extendablecookiechangeevent-changed</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-extendablecookiechangeevent-changed">4.2. The ExtendableCookieChangeEvent interface</a>
    <li><a href="#ref-for-dom-extendablecookiechangeevent-changed①">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-extendablecookiechangeevent-deleted">
   <b><a href="#dom-extendablecookiechangeevent-deleted">#dom-extendablecookiechangeevent-deleted</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-extendablecookiechangeevent-deleted">4.2. The ExtendableCookieChangeEvent interface</a>
    <li><a href="#ref-for-dom-extendablecookiechangeevent-deleted①">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-extendablecookiechangeeventinit">
   <b><a href="#dictdef-extendablecookiechangeeventinit">#dictdef-extendablecookiechangeeventinit</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-extendablecookiechangeeventinit">4.2. The ExtendableCookieChangeEvent interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-window-cookiestore">
   <b><a href="#dom-window-cookiestore">#dom-window-cookiestore</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-window-cookiestore">1.3. Querying Cookies</a>
    <li><a href="#ref-for-dom-window-cookiestore①">1.4. Modifying Cookies</a>
    <li><a href="#ref-for-dom-window-cookiestore②">5.1. The Window interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-serviceworkerglobalscope-cookiestore">
   <b><a href="#dom-serviceworkerglobalscope-cookiestore">#dom-serviceworkerglobalscope-cookiestore</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-serviceworkerglobalscope-cookiestore">5.2. The ServiceWorkerGlobalScope interface</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="encode">
   <b><a href="#encode">#encode</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-encode">6.2. Set a Cookie</a> <a href="#ref-for-encode①">(2)</a> <a href="#ref-for-encode②">(3)</a> <a href="#ref-for-encode③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="decode">
   <b><a href="#decode">#decode</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-decode">6.1. Query Cookies</a> <a href="#ref-for-decode①">(2)</a> <a href="#ref-for-decode②">(3)</a> <a href="#ref-for-decode③">(4)</a> <a href="#ref-for-decode④">(5)</a>
    <li><a href="#ref-for-decode⑤">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="query-cookies">
   <b><a href="#query-cookies">#query-cookies</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-query-cookies">3.1. The get() method</a> <a href="#ref-for-query-cookies①">(2)</a>
    <li><a href="#ref-for-query-cookies②">3.2. The getAll() method</a> <a href="#ref-for-query-cookies③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="matches">
   <b><a href="#matches">#matches</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-matches">6.1. Query Cookies</a>
    <li><a href="#ref-for-matches①">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="create-a-cookielistitem">
   <b><a href="#create-a-cookielistitem">#create-a-cookielistitem</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-create-a-cookielistitem">6.1. Query Cookies</a>
    <li><a href="#ref-for-create-a-cookielistitem①">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="as-a-timestamp">
   <b><a href="#as-a-timestamp">#as-a-timestamp</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-as-a-timestamp">6.1. Query Cookies</a>
    <li><a href="#ref-for-as-a-timestamp①">6.3. Delete a Cookie</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="set-a-cookie">
   <b><a href="#set-a-cookie">#set-a-cookie</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-set-a-cookie">3.3. The set() method</a> <a href="#ref-for-set-a-cookie①">(2)</a>
    <li><a href="#ref-for-set-a-cookie②">6.3. Delete a Cookie</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="date-serialize">
   <b><a href="#date-serialize">#date-serialize</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-date-serialize">6.2. Set a Cookie</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="delete-a-cookie">
   <b><a href="#delete-a-cookie">#delete-a-cookie</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-delete-a-cookie">3.4. The delete() method</a> <a href="#ref-for-delete-a-cookie①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="process-cookie-changes">
   <b><a href="#process-cookie-changes">#process-cookie-changes</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-process-cookie-changes">2.2. Cookie Store</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="observable-changes">
   <b><a href="#observable-changes">#observable-changes</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-observable-changes">6.4. Process Changes</a> <a href="#ref-for-observable-changes①">(2)</a> <a href="#ref-for-observable-changes②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cookie-change">
   <b><a href="#cookie-change">#cookie-change</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cookie-change">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="fire-a-change-event">
   <b><a href="#fire-a-change-event">#fire-a-change-event</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fire-a-change-event">6.4. Process Changes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="prepare-lists">
   <b><a href="#prepare-lists">#prepare-lists</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-prepare-lists">6.4. Process Changes</a> <a href="#ref-for-prepare-lists①">(2)</a>
   </ul>
  </aside>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>